Forum: JRuby Jruby complete and bundle

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Tim Uckun (Guest)
on 2013-12-02 05:03
(Received via mailing list)

I have found a couple of web sites which describe how to use jruby
but it doesn't seem to work for me.

/usr/bin/java -jar /vagrant/bin/jruby-complete-1.7.8.jar -S bundle exec
jruby: No such file or directory -- bundle (LoadError)

Similarly I can't invoke rake either.

Could somebody point out what I am doing wrong.

Christian MICHON (Guest)
on 2013-12-02 06:48
(Received via mailing list)
Bundler is not in jruby complete. You need to add it into the jar file
manually, or install it in a physical folder and add this path to gem

The 1st option is what I usually do.
Tim Uckun (Guest)
on 2013-12-02 07:00
(Received via mailing list)
I tried using bundler to bundle bundler but that didn't work. I put the
bundler in my gemfile and then did a bundle packake which moved all the
gems to /vendor/cache but not bundler. Odd.

How do I put it into the jar file?
974b3d592f78510db0227e528841ccb9?d=identicon&s=25 Robin McKay (robin2)
on 2013-12-02 09:49
There seems to be two threads associated with this topic - perhaps
someone can merge them.

The easiest way to use JRuby complete - assuming the JVM is already
installed is to create a directory structure for your program project
like this


Put a copy of jruby-complete-xxx.jar into lib

Create a shell script (I call mine in the project
directory with this content


   export PATH=$PWD:$PATH;
   export GEM_HOME=$PWD/GemHome;

As far as I know a similar .bat file will work on Windows

Just for convenience make another shell script called JRUBY with this in


   java -jar lib/jruby-complete-1.7.0.jar $*

When you double-click the shell script it opens a terminal at the
project directory and then you can run your program with JRUBY myprog.rb
and you can list gems and do all the other stuff with JRUBY -S gem list.

Once you have created this framework you can just copy it somewhere else
to start another project.

No need for RVM or Bundler or any of that stuff - JRuby makes Ruby
Really Simple.

Christian MICHON (Guest)
on 2013-12-02 10:20
(Received via mailing list)
The headline of the thread was clear: the issue is on how to use bundler
with jruby-complete.

Your sentence 'No need for RVM or Bundler or any of that stuff' is out
context I guess.

I see only 1 thread here, not 2.
974b3d592f78510db0227e528841ccb9?d=identicon&s=25 Robin McKay (robin2)
on 2013-12-02 15:49
... if you insist on doing things the hard way.

Tim Uckun (Guest)
on 2013-12-03 09:25
(Received via mailing list)
Just to follow up on this advice.

I have a rails app I am using for testing. It has no real functionality
I put a bunch of gems in the Gemfile to test them.  Because this is a
I am using the jruby complete gem with bundler in it. I used the
instructions in the gist somebody posted here to put bundler in the
complete gem.

I installed all the gems into vendor using this script


${jruby}  -S gem install -i ${VENDORED_GEM_HOME} --no-rdoc --no-ri
${jruby}  -S gem install -i ${VENDORED_GEM_HOME} --no-rdoc --no-ri rake
${jruby} -S bundle install --path=${VENDORED_GEM_HOME} --binstubs
development test

Then I did a vagrant up  to fire up a VM with nothing but java installed
and attempted to list the gems



${jruby} -S gem list

gives the following output

*** LOCAL GEMS ***

bundler (1.3.5)
rake (10.1.0)

mmmm. Only two gems.  I get the feeling it's only looking into the jar
ignoring the GEM_HOME.  Let's try bundler

${jruby} -S bundle list

Gems included by the bundle:
Could not find rake-10.1.0 in any of the sources

So weird.

Christian MICHON (Guest)
on 2013-12-03 10:03
(Received via mailing list)
Then I would suggest the following:
- create a vendor folder at the top of your rails app, where the Gemfile
- inside this vendor folder, create a cache folder (you can do steps 1
2 by doing 'mkdir -p vendor/cache')
- then use bundle with 'bundle --path vendor/bundle'.

This will install the gems in vendor/bundle and not in the system. This
will ensure a non pollution of your system and easy deployment.

If you follow these steps, bundle list will work and list what is in
vendor/bundle accordingly.
Tim Uckun (Guest)
on 2013-12-03 10:22
(Received via mailing list)
Actually this is exactly what I am doing.

One thing I noticed is that bundler installs the gems into
vendor/bundle/jruby/1.9 so you have to set the GEM_PATH to that
and not to vendor/bundle. If I do that then I can list all the gems but
still can't run trinidad because it says rake is missing.  I tried
installing rake into that directory but that doesn't seem to do

I feel like I am bit closer to making this work but still not there.

On Tue, Dec 3, 2013 at 10:01 PM, Christian MICHON <
Christian MICHON (Guest)
on 2013-12-03 10:31
(Received via mailing list)
No: vendor/bundle/jruby/1.9 is the correct path for bundler. Do not set

Rake is not missing, it's installed in your jruby-complete. But nothing
stops you from adding it into your Gemfile.

Could you share your Gemfile and maybe how your simple rails app is

I used this vendor/bundler approach with sinatra and trinidad (or
and it works out of the box with jruby...
This topic is locked and can not be replied to.