0

I have the problem running tests using rake requiring java.

require 'java'

The message I get after:

>RAILS_ENV=test rake spec SPEC_OPTS="-e 'view missing container alert'"

is

rake aborted!
cannot load such file -- java

I admit that I am a newbie to jruby and all of this can be just my mistake, but I would appreciate showing me into the right direction. From what I search and learned it is all because it is ruby and not jruby that is called.

I have rvm installed and after rvm list it shows me:

    rvm rubies

=* jruby-1.7.13 [ x86_64 ]
   jruby-1.7.5 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

However, jruby -v says I have no jruby installed. I updated my $PATH so that it points to the jruby location from rvms (I am not sure if it was the right step to do?)

export PATH=/home/me/.rvm/gems/jruby-1.7.5/bin:$PATH

Thanks for any hints.

I found this thread, but it doesn't seem to cover my problem.

Community
  • 1
  • 1
kch
  • 57
  • 1
  • 8
  • probably not - likely your RVM installation is not complete (I would try `rvm get latest` and watch for any warnings) ... `echo $PATH` after doing a `rvm use jruby` should start something like this: **/opt/local/rvm/gems/jruby-1.7.12/bin:/opt/local/rvm/gems/jruby-1.7.12@global/bin:/opt/local/rvm/rubies/jruby-1.7.12/bin:/opt/local/rvm/bin:/opt/java/jdk/bin:/usr/bin** – kares Jul 23 '14 at 16:20
  • OK, it was due to RVM not being recognised as a function... I added `[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"` to my `.bashrc` as suggested in [this post](http://stackoverflow.com/questions/9336596/rvm-installation-not-working-rvm-is-not-a-function) and the next steps were as you described @kares, thanks. I guess it can be closed as duplicate. – kch Jul 24 '14 at 06:39

0 Answers0