Jruby PATH and RUBYOPTS integration

Hi,
I download the last jruby version and install the rspec gem using jgem
to install.

After it, I export RUBYOPT=rubygems to guarantee that the spec can be
found.

Trying to run the spec by normal mode I got:

[email protected]:~/jruby-1.6.1$ jruby -S spec
LoadError: no such file to load – spec/autorun
require at org/jruby/RubyKernel.java:1038
(root) at /usr/bin/spec:2

Trying to execute directly from the original binary:
[email protected]:~/jruby-1.6.1$ echo $RUBYOPT
rubygems
[email protected]:~/jruby-1.6.1$ bin/jruby -S
lib/ruby/gems/1.8/gems/rspec-core-2.5.1/bin/rspec


Could not find ‘rspec/autorun’

This may happen if you’re using rubygems as your package manager, but
it is not
being required through some mechanism before executing the rspec
command.

You may need to do one of the following in your shell:

# for bash/zsh
export RUBYOPT=rubygems

# for csh, etc.
set RUBYOPT=rubygems

For background, please see http://gist.github.com/54177.


How can I run rspec through jruby in this case?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs