From: Eric Hodel Date: 2006-12-21T07:58:06+09:00 Subject: Re: [ ruby-Bugs-7278 ] Kernel#system broken inside Dir.chdir(&block) if system command doesn't have shell characters On Dec 15, 2006, at 18:09, Nobuyoshi Nakada wrote: > At Fri, 15 Dec 2006 06:59:52 +0900, > wrote in [ruby-core:09722]: >> % ruby -v -e 'Dir.chdir("p4") { system "/usr/local/bin/p4 info" }' >> ruby 1.8.5 (2006-08-25) [i686-darwin8.8.1] >> Perforce client error: >> Connect to server failed; check $P4PORT. >> TCP connect to perforce failed. >> perforce: host unknown. > > Could you elaborate the problem? > > * does work without Dir.chdir > (chdir p4; ruby -e 'system "/usr/local/bin/p4 info"') > > * does work with -C option > ruby -C p4 -e 'system "/usr/local/bin/p4 info"' > > * does work outside chdir block > ruby -e 'Dir.chdir("p4"); system "/usr/local/bin/p4 info"' > > Also, do them work with "printenv P4PORT" instead of > /usr/local/bin/p4? There's a minimal test case in [ruby-talk:230639]. -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net I LIT YOUR GEM ON FIRE!