JRuby-1.6.5 custom gem path

I’m trying to make it so that gems are installed and loaded different
directory than JRUBY_HOME. I’m having an issue accomplishing this and am
posting to the list to see if this is a bug or if I’m missing a
configuration variable somewhere. If it’s a bug let me know and I’ll
post an issue to JIRA. This directory is /home/cwgem/gems/jruby-1.6.5.
If I use the following jrubyrc dotfile:

gem.home=/home/cwgem/gems/jruby-1.6.5
gem.path=/home/cwgem/gems/jruby-1.6.5
compat.version=1.9

Gems get installed there but attempting to load them either via
-rgemhere on the command line or require "gemhere" fails. Here is an
example run:

Install


$ jgem install xml-simple
Fetching: xml-simple-1.1.1.gem (100%)
Successfully installed xml-simple-1.1.1
1 gem installed

Verification


$ ls /home/cwgem/gems/jruby-1.6.5/gems/xml-simple-1.1.1
lib

Load Attempt (command line)


$ jruby -rxml-simple -e ‘1’
LoadError: no such file to load – xml-simple

Load Attempt (script)


$ echo ‘require “xml-simple”’ >> test.rb
$ jruby test.rb
LoadError: no such file to load – xml-simple
require at org/jruby/RubyKernel.java:1047
require at
/home/cwgem/ruby/jruby-1.6.5/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36
(root) at test.rb:1

Version Info


jruby 1.6.5 (ruby-1.9.2-p136) (2011-10-25 9dcd388) (Java HotSpot™
64-Bit Server VM 1.7.0_02-ea) [linux-amd64-java]

  • Chris (@cwgem)

On Nov 4, 2011, at 4:42 PM, Chris W. wrote:



$ jruby test.rb

  • Chris (@cwgem)

This is weird. With the same setup, ‘nokogiri’ is installed and found. I
suspect it is the hyphen that’s causing a problem.