Hi,
I’m running a JTestR script via JRuby’s distribution jar: (forgive the
very
long command)
/opt/boisvert/jdk1.6.0_26/bin/java -classpath
/home/boisvert/git/buildr/lib/buildr/java:/home/boisvert/.m2/repository/org/jruby/jruby-complete/1.6.2/jruby-complete-1.6.2.jar:/home/boisvert/.m2/repository/org/jtestr/jtestr/0.6/jtestr-0.6.jar:/home/boisvert/.m2/repository/junit/junit/4.8.2/junit-4.8.2.jar:/home/boisvert/.m2/repository/org/jmock/jmock/2.5.1/jmock-2.5.1.jar:/home/boisvert/.m2/repository/org/jmock/jmock-junit4/2.5.1/jmock-junit4-2.5.1.jar:/home/boisvert/.m2/repository/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar:/home/boisvert/.m2/repository/org/hamcrest/hamcrest-library/1.1/hamcrest-library-1.1.jar:/home/boisvert/.m2/repository/org/testng/testng/5.10/testng-5.10-jdk15.jar:/home/boisvert/git/buildr/tmp:/opt/boisvert/jruby-1.6.2/lib/jruby.jar
-Djruby.home=/opt/boisvert/jruby-1.6.2/ -DbaseDir= -Xmx512m
org.jruby.Main
/home/boisvert/git/buildr/tmp/target/spec/runner.rb
/home/boisvert/git/buildr/tmp/src/spec/ruby/some_spec.rb"
Gem::LoadError: can’t activate rspec (= 1.3.0, runtime), already
activated
rspec-2.1.0. Make sure all dependencies are added to Gemfile.
gem at
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:153
call at org/jruby/RubyProc.java:268
(root) at /home/boisvert/git/buildr/tmp/target/spec/runner.rb:32
(If you’re wondering, I’m running Buildr specs that test our JTestR +
JRuby
integration)
As you can see, the script attempts to activate rspec 1.3.0 – but it’s
too
late because somehow JRuby has already activated rspec 2.1.0. Somehow
JRuby picks up the native bundler installation and the bootstrap process
activates gems based on a Gemfile found (I guess somewhere in a parent
of
the current directory).
So, how come JRuby picks up the native bundler? Is there a way to
disable
this? I’m confused since I would expect JRuby to only use gems under
jruby.home (since it was passed explicitly).
thanks for any help,
alex