Issue Type: Bug Bug
Affects Versions: JRuby 1.7.2
Assignee: Unassigned
Components: Core Classes/Modules
Created: 18/Feb/13 7:42 AM
Description:

Hello folk.

I believe that this issue is an unresolved issue that stil has NOT been fixed in JRuby 1.7.2. If you search on JAVA_HOME you find different variations of the same problem or problems. E.g. see: http://jira.codehaus.org/browse/JRUBY-4124

This evening I meticuliously worked through simple examples (below). I have been having issues connected to this with the gem ruby script. Some commands work and some don't. At first I thought it might be a gem problem. Then I found other issues with things like rake, and bundler.

In a nutshell, something goes crook with the Windows environment. The most un-useful manifestation is when the JAVA_HOME value gets mess with.

In Bug: JRUBY-4124; the user reported that removing JAVA_HOME helped. I have verified this result below (as well, on JRuby 1.7.2). While that demonstrates that the error is with the interfact to the Windows environment, it is not acceptable for development purposes of testing (and a long list of other things that 'want' a JAVA_HOME to feel comfortable.

The JAVA_HOME problem is that in some cased the JAVA_HOME path printed by the JRuby error message is plain wrong. It has a "/jre" folder appended to the JAVA_HOME path; which doesn't work and the script falls in a smoking heap.

Some ruby scripts fail and some work. It is a patchy affair. Also I've noticed if there's a problem with a .RB file's parameters (e.g. "gem -v" instead of capital-V: "gem -V") gives a different error about the Windows environment. In other words if you can force an error in the Ruby file's arg-s, it can push the problem with one or other environment string.

With the examples below. I find about 90% of the Gem commands work and none of the Bundler commands work. The default of Bundle (no parameters) works for install – This is definitly a critical situation.

The things that can go wrong with Gem-s are weird. For examle my current folder (pwd) is "Z:\$$$\xxx", but "ruby gem list -v" prints that the folder is: "Z:\$$$\xxx%HOME%" (with the % sign). I worked around that issue by manipulating my HOME variable.

Final comment; I think it is unfortunate that a large number of bugs that resemble this behaviour have been closed as, "won't fix" and "not a problem" spanning several years. That's a pretty big commitment to not find the root cause and a skip solving the problem. The JRUBY-4124 bug was closed as "fixed" in 2009. Well it persists now in 2013.

As a SUGGESTION:

Please make a JRuby start-up option to show the environment passed to the Ruby script being executed?

At the very least, this will demonstrate if a script has a bug, and when JRuby has the problem. What do you think?

~~~~~[ Java home ]~~~~~

See that JAVA_HOME is set to: "c:\.bin\lang\java\jre\x64\v1.7\u11" (Java 7 u11).

echo ^ JAVA_HOME = %JAVA_HOME%
JAVA_HOME = c:\.bin\lang\java\jre\x64\v1.7\u11\

~~~~~[ examples ]~~~~~

"b:\lang\ruby\jruby\v01.07\bin\jruby.exe" "b:\lang\ruby\jruby\v01.07\bin\bundle" list
Cannot locate Java installation, specified by JAVA_HOME:
c:\.bin\lang\java\jre\x64\v1.7\u11\jre

"b:\lang\ruby\jruby\v01.07\bin\jruby.exe" "b:\lang\ruby\jruby\v01.07\bin\bundle" "list"
Cannot locate Java installation, specified by JAVA_HOME:
c:\.bin\lang\java\jre\x64\v1.7\u11\jre

"b:\lang\ruby\jruby\v01.07\bin\jruby.exe" "b:\lang\ruby\jruby\v01.07\bin\gem" "list"

      • LOCAL GEMS ***

bundler (1.2.4)
daemons (1.1.9)
eventmachine (1.0.0 java)
jruby-win32ole (0.8.5)
rack (1.5.2)
rack-protection (1.3.2)
rake (10.0.3, 10.0.2)
sinatra (1.3.4)
tilt (1.3.3)

~~~~~[ clear JAVA_HOME ]~~~~~

set JAVA_HOME=

"b:\lang\ruby\jruby\v01.07\bin\jruby.exe" "b:\lang\ruby\jruby\v01.07\bin\bundle" "list"

Gems included by the bundle:

  • bundler (1.2.4)
  • rack (1.5.2)
  • rack-protection (1.3.2)
  • sinatra (1.3.4)
  • tilt (1.3.3)

~~~~~[ jruby ]~~~~~

"b:\lang\ruby\jruby\v01.07\bin\jruby.exe" --version
jruby 1.7.2 (1.9.3p327) 2013-01-04 302c706 on Java HotSpot(TM) 64-Bit Server VM 1.7.0_11-b21 [Windows 7-amd64]

Environment: Windows 7 (64-bit), SP1; Java 7 u11
Project: JRuby
Priority: Critical Critical
Reporter: will mason
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to