I’m trying to automate some build with maven and would like to automate
it as much as possible without requiring the potential users to install
JRuby, gems, etc. Therefore what I do is to invoke Ant with the JRuby
dependencies and run commands against the jar itself. To test that it
works, first I try to do it from the command line. But so far I’m
failing. I am executing the following:
First weird thing is that I need to set GEM_PATH. If I only set
most of the commands work, but then when I run rake rspec I get the
message: “no such file to load – set” refering to a line in the
Rakefile that has the following content “Bundler.setup(:default,
:development)”… So I’m not sure as what does that mean.
This runs ok. Dependencies are installed into GEM_HOME
java -jar jruby-complete.jar -S gem install … all dependencies here
Now, this fails
java -jar jruby-complete.jar -S rake spec
And this is the error:
-S bundle exec rspec “spec/test_spec.rb”
jruby: No such file or directory – bundle (LoadError)
It looks like when I run rake spec, jruby is not enforcing GEM_HOME and
so it tries to load the gems from within the JAR file, which of course
I’m not sure if there is any way to say to JRuby to load the gems from
some folder as otherwise this has to be a bug.
Also I think it is worth to mention that I’ve gone through all these
steps running them with jruby shell and then everything works fine, so
it has to be an issue related to the jar.
What do you think?