Hi,
In message ""wrong argument type nil (expected String)" from Dir.chdir"
|Can anybody tell me why this line:
|
|Dir.chdir("/")
|
|results in the error "wrong argument type nil (expected String)" when
|running in the debugger (ruby -r debug), but not when running in irb?
Can't reproduce. Could you give me more information? Your platform,
and exact version of ruby interpreter (shown by ruby -v).
matz.
Thanks Matz.
Sorry, should have posted a bit more information to start with. I'm
running under SuSE Linux 8.2, kernel 2.4 (can't find the full version
number). ruby -v reports:
ruby 1.6.8 (2002-12-24) [i686-linux]
After having problems with a similar statement as the first statement in
a program, I tried creating a new program with just the one line I
posted above. That shorter program also returns the "wrong argument type
nil (expected String)" error. However, typing the same line into irb
works fine and returns 0 (and after doing so, typing Dir.getwd into irb
returns the expected "/").
Grateful for any help you can provide.