Issue Type: Bug Bug
Affects Versions: JRuby 1.7.0.RC1, JRuby 1.6.8
Assignee: Thomas E Enebo
Created: 27/Sep/12 7:03 PM
Description:

I was surprised by this when upgraded a production deployment to jruby 1.6.8 from jruby 1.6.7. The file /etc/gemrc is no longer read, so my private rubygems repo wasn't being found.

Instead, in jruby 1.6.7.2, 1.6.8 and the 1.7.0.RC1 candidate that I tested, rubygems is looking in a jruby distro internal etc directory, which the jruby distribution doesn't even include. Here is a demonstration via strace of jruby 1.6.7 (as expected):

% strace -e trace=all jruby-1.6.7 -S  gem environment |& grep gemrc
stat64("/etc/gemrc", 0xffffffffffac99ac) = -1 ENOENT (No such file or directory)
stat64("/home/david/.gemrc", 0xffffffffffac99ec) = -1 ENOENT (No such file or directory)

Versus all newer releases (note location of .../etc/gemrc).

% strace -e trace=all jruby-1.6.7.2 -S gem environment |& grep gemrc
stat64("/opt/dist/jruby-1.6.7.2/etc/gemrc", 0xffffffffff81403c) = -1 ENOENT (No such file or directory)
stat64("/home/david/.gemrc", 0xffffffffffb5a09c) = -1 ENOENT (No such file or directory)

% strace -e trace=all jruby-1.6.8 -S gem environment |& grep gemrc
stat64("/opt/dist/jruby-1.6.8/etc/gemrc", 0xffffffffffb5a05c) = -1 ENOENT (No such file or directory)
stat64("/home/david/.gemrc", 0xfffffffffff8e24c) = -1 ENOENT (No such file or directory)

% strace -e trace=all jruby-1.7 -S gem environment |& grep gemrc
stat64("/opt/dist/jruby-1.7.0.RC1/etc/gemrc", 0xffffffffff9b311c) = -1 ENOENT (No such file or directory)
stat64("/home/david/.gemrc", 0xffffffffffb9631c) = -1 ENOENT (No such file or directory)

The workaround is obviously to place the gemrc where indicated, but in order to do that you need to know where, and its not terribly obvious. Below is output for the CONFIG property that appears to control it, but only for these later builds (on 1.6.7 it doesn't match):

% jruby-1.6.8 -r rbconfig -e "puts Config::CONFIG['sysconfdir']"
["sysconfdir", "/usr/local/lib/jruby/jruby-1.6.8/etc"]

% jruby-1.6.7 -r rbconfig -e "puts Config::CONFIG['sysconfdir']"
["sysconfdir", "/usr/local/lib/jruby/jruby-1.6.7/etc"]

So if nothing else, let this bug report be proto-documentation.

Environment: jruby 1.6.8 (ruby-1.9.2-p312) (2012-09-18 1772b40) (Java HotSpot(TM) Server VM 1.7.0_07) [linux-i386-java]
Project: JRuby
Priority: Minor Minor
Reporter: David Kellum
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