warbler
warbler copied to clipboard
Bundler error when creating jar using jruby-jars 9.1.9.0
When attempting to execute the compiled jar file when warbler packs in jruby-jars-9.1.9.0:
LoadError: no such file to load -- bundler/shared_helpers
require at org/jruby/RubyKernel.java:961
require at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:130
<main> at uri:classloader:/META-INF/init.rb:21
require at org/jruby/RubyKernel.java:961
(root) at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
<main> at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54
ERROR: org.jruby.embed.EvalFailedException: (LoadError) no such file to load -- bundler/shared_helpers
Seems like warbler will always use the latest available copy of the jruby-jars gem regardless of what is specified in the Gemfile, but after uninistalling jruby-jars-9.1.9.0 it packed up 9.1.8.0 which doesn't have the same issue.
Appears to just be a `require 'bundler/shared_helpers', and bundler is present in the gems folder of the created jar so I'm guessing it's something to do with changes in 9.1.9.0?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
could you please double check? also what would be your Bundler version, could you try out 1.13.x?
have been using gem 'jruby-jars'
and Warbler seems to always packed the gem from the lockfile.
Here: https://github.com/karlhe/warbler-test
It does pack the jruby-jars gem, however the files in META-INF/lib are still the 9.1.9.0 jars since they are available in my gems. The jar from this project also has the bundler/shared_helpers issue.
I'm running this on Windows with JRuby 9.19.0 and IBM JRE 8.0.3.22.
Retried with bundler 1.13.7 with the same results.
Hello @karlhe,
I have the same problem. I try with bundler 1.13.7 and don't work for me too.
This versions works for me.
ruby '2.2.3', engine: 'jruby', engine_version: '9.0.5.0'
gem 'bundler', '1.9.9'
gem 'rack', '1.6.0'
gem 'warbler', '1.4.7'
Was the difference for you the jruby version or the bundler version? I'm just using jruby 9.1.7.0 for now (had some possibly unrelated issues with 9.1.8.0 with gettimeofday on windows).
@karlhe I don't try with other bundler version. I get this versions of another project that works in Windows.
I will try with last version of warbler and jruby 9.1.7.0. Thanks.
Having the same issue or similar issue with jruby 9.2.0.0
org.jruby.rack.RackInitializationException: no such file to load -- bundler/shared_helpers
from org/jruby/RubyKernel.java:970:in `require'
from uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:59:in `require'
from file:/private/var/folders/vc/4wylg3v16rl300r92xwnrfjr0000gn/T/jetty-0.0.0.0-8080-rukh5.war-_-any-8621070288033095318.dir/webapp/META-INF/init.rb:26:in `<eval>'
from org/jruby/RubyKernel.java:1037:in `eval'
from uri:classloader:/jruby/rack/booter.rb:256:in `block in load_settings_from_init_rb'
from org/jruby/RubyArray.java:1801:in `each'
from uri:classloader:/jruby/rack/booter.rb:243:in `load_settings_from_init_rb'
from uri:classloader:/jruby/rack/booter.rb:99:in `boot!'
from uri:classloader:/jruby/rack/rails_booter.rb:26:in `boot!'
from uri:classloader:/jruby/rack/boot/rails.rb:10:in `<main>'
from org/jruby/RubyKernel.java:994:in `load'
from <script>:1:in `<main>
Me too. Anyone got any ideas? :)
@rebelwarrior and anyone else struggling with this. I found that warbler will try to use the 9.2.0.0 'complete' jar when building, even when warbling under an older JRuby. The workaround is to explicitly lock the version of 'jruby-jars' to the version of JRuby you're using.
For example, on my project, we're using 9.1.16.0 presently, so i've added:
gem 'jruby-jars', '9.1.16.0'
to my Gemfile. This allows Warbler to work correctly, packaging the jruby-core-9.1.16.0-complete.jar
. Without this explicit requirement in the Gemfile, it tries to package the 9.2.0.0 equivalent, which causes the Bundler problem.
Credit to @mdsell for the workaround 👍
Oh I’m actually trying to use 9.2.0.0. But yeah if you’re trying to use an older version you need to lock it in your gem file.
Sent from my mobile
On Jun 12, 2018, at 5:21 AM, Rory Sinclair [email protected] wrote:
@rebelwarrior and anyone else struggling with this. I found that warbler will try to use the 9.2.0.0 'complete' jar when building, even when warbling under an older JRuby. The workaround is to explicitly lock the version of 'jruby-jars' to the version of JRuby you're using.
For example, on my project, we're using 9.1.16.0 presently, so i've added:
gem 'jruby-jars', '9.1.16.0'
to my Gemfile. This allows Warbler to work correctly, packaging the jruby-core-9.1.16.0-complete.jar. Without this explicit requirement in the Gemfile, it tries to package the 9.2.0.0 equivalent, which causes the Bundler problem.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
I'm also experiencing the above error with 9.2.0.0.
I've tried bundler "< 1.16.0" and 1.16.2.
The files in WEB-INF/lib are definitely the jruby 9.2.0.0 ones, so this is not caused by the wrong jruby-jars version, at least here.
I was suddenly running into this error as well. Things worked fine until recently, but starting today loading the exploded war (in Websphere Liberty) resulted in LoadError: no such file to load -- bundler/shared_helpers
.
The problem was solved when I restarted the Websphere server from a shell that had an RVM context that was the same as the RVM context used to build the .war
. Not yet sure why that dependency exists.