JRuby

ENV[PATH] variable not properbly set on windows

Details

  • Number of attachments :
    0

Description

When trying to use "jruby -S warble war" i get the following error:

[exec] private method `split' called for nil:NilClass
[exec] Q:/app/codehaus/jruby_1_2_0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/repaired_system.rb:109:in `find_runnable'
[exec] (See full trace by running task with --trace)

According source line: "[nil, ".", *ENV["PATH"].split(";")].each { |path| ..."

After some research i found out whats the problem:
JRuby cant access ENV[PATH] ( its nil ), the problem is that Windows names the Variable as "Path" instead of "PATH"

I found out that "original" ruby ignore cases when accsessing the "ENV[PATH]" variable
Q:\>ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

Q:\>irb
irb(main):001:0> puts ENV['PATH']
c:\Programme\ruby\bin;C:\Programme\Windows Resource Kits\Tools\;C:\Programme\IBM\WebSphere MQ\Java\lib;C:\ora\o1020\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programme\IDM Computer Solutions\UEStudio '06;C:\Programme\IBM\WebSphere MQ\bin;C:\Programme\IBM\WebSphere MQ\tools\c\samples\bin;C:\Programme\CollabNet Subversion;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;C:\strawberry\c\bin;C:\strawberry\perl\bin;C:\Programme\TortoiseSVN\bin;C:\Programme\MySQL\MySQL Server 5.1\bin;C:\WINDOWS\system32\WindowsPowerShell\v1.0;c:\Programme\JRuby\bin;C:\Programme\IDM Computer Solutions\UEStudio '06\;c:\Programme\cygwin;Q:\app\sun\jdk_1_6_0_13\bin\;
=> nil

When using jruby instead with the same commands i get the following output:
Q:\>jruby -v
jruby 1.2.0 (ruby 1.8.6 patchlevel 287) (2009-03-16 rev 9419) [x86-java]

Q:\>jruby -S irb
irb(main):001:0> puts ENV['PATH']
nil
=> nil
irb(main):002:0> puts ENV['Path']
c:\Programme\ruby\bin;C:\Programme\Windows Resource Kits\Tools\;C:\Programme\IBM\WebSphere MQ\Java\lib;C:\ora\o1020\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programme\IDM Computer Solutions\UEStudio '06;C:\Programme\IBM\WebSphere MQ\bin;C:\Programme\IBM\WebSphere MQ\tools\c\samples\bin;C:\Programme\CollabNet Subversion;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;C:\strawberry\c\bin;C:\strawberry\perl\bin;C:\Programme\TortoiseSVN\bin;C:\Programme\MySQL\MySQL Server 5.1\bin;C:\WINDOWS\system32\WindowsPowerShell\v1.0;c:\Programme\JRuby\bin;C:\Programme\IDM Computer Solutions\UEStudio '06\;c:\Programme\cygwin;Q:\app\sun\jdk_1_6_0_13\bin\;
=> nil

A fix would be to just ignore case when accessing path as done in "original" ruby

Activity

Hide
Martin Körner added a comment -

Just want to add, that this problem occurs under Windows Vista, too

Show
Martin Körner added a comment - Just want to add, that this problem occurs under Windows Vista, too
Hide
Charles Oliver Nutter added a comment -

I think we fixed this in the 1.3 cycle by having ENV ignore case when on Windows.

Show
Charles Oliver Nutter added a comment - I think we fixed this in the 1.3 cycle by having ENV ignore case when on Windows.

People

Vote (2)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: