hi list,
I use rvm for some time, but once in a while I encounter unexplainable
problems. I hope you can help me on this one. I use zsh. My problem is
that jruby seems to be unable to locate a gem while it is installed.
I have tried to create a short and complete example showing the
problem. I hope one of you can tell me what I am overlooking.
This output shows the problem:
$ mkdir rvm
$ cd rvm
$ echo "rvm use jruby-1.6.5" > .rvmrc
$ echo "rvm jruby-1.6.5@rvm" >> .rvmrc
$ cd /tmp; cd -
~/rvm
==============================================================================
=
NOTICE
=
==============================================================================
= RVM has encountered a new or modified .rvmrc file in the current
directory =
= This is a shell script and therefore may contain any shell
commands. =
=
=
= Examine the contents of this file carefully to be sure the contents
are =
= safe before trusting it! ( Choose v[iew] below to view the
contents ) =
==============================================================================
Do you wish to trust this .rvmrc file? (/export/home/rdgon/rvm/.rvmrc)
y[es], n[o], v[iew], c[ancel]> yes
Using /export/home/rdgon/.rvm/gems/jruby-1.6.5
ERROR: Gemset 'rvm' does not exist, rvm gemset create 'rvm' first.
WARN: Gemset doesn't exist, proceeding with default gemset
Using /export/home/rdgon/.rvm/gems/jruby-1.6.5
$ rvm gemset create 'rvm'
'rvm' gemset created (/export/home/rdgon/.rvm/gems/jruby-1.6.5@rvm).
$ echo "source '
https://rubygems.org'" > Gemfile
$ echo "gem( 'net-sftp', '2.1.2')" >> Gemfile
$ cd /tmp; cd -
Now using system ruby.
~/rvm
Using /export/home/rdgon/.rvm/gems/jruby-1.6.5
Using /export/home/rdgon/.rvm/gems/jruby-1.6.5 with gemset rvm
$ which bundle
/export/home/rdgon/.rvm/gems/jruby-1.6.5/bin/bundle
$ bundle install
Fetching gem metadata from
https://rubygems.org/.......
Resolving dependencies...
Installing net-ssh (2.6.7)
Installing net-sftp (2.1.2)
Using bundler (1.3.1)
Your bundle is complete! Use `bundle show [gemname]` to see where a
bundled gem is installed.
$ bundle show net-sftp
/export/home/rdgon/.rvm/gems/jruby-1.6.5@rvm/gems/net-sftp-2.1.2
$ echo "require 'net/sftp'" > tester
$ which jruby
/export/home/rdgon/.rvm/rubies/jruby-1.6.5/bin/jruby
$ jruby tester
LoadError: no such file to load -- net/sftp
require at org/jruby/RubyKernel.java:1038
(root) at tester:1
zsh: exit 1 jruby tester
As you can see the net-sftp gem IS installed but I keep getting the
'no such file to load' message, and this happens too if I do not make
use of a gemset, but install the gem in the jruby-1.6.5 directory
itself.
I found out that if I do exactly the same but not using jruby-1.6.5,
but ruby-1.9.2 instead, it works without problem. Maybe it is
unrelated to rvm?
thanks in advance, Ruud