Skip to content
This repository

JRuby 1.6.4 doesn't automatically find jruby-openssl 0.7.4 #11

Open
Confusion opened this Issue · 1 comment

1 participant

Ivo Wever
Ivo Wever

The short version:

jruby -S bundle install doesn't work when an https gemserver is referenced in the Gemfile, but
jruby -ropenssl -S bundle install works correctly.

Steps to reproduce:

  • Download the jruby-bin-1.6.4 tarball and extract it.
  • Execute jruby -v to verify the correct binary is referenced.
  • Update to the latest rubygems: jruby -S gem update --system. This currently installs 1.8.10. (It seems JRuby ships a patched version of rubygems 1.5.1, because this isn't supposed to work for 1.5.1.)
  • Install the latest bundler: jruby -S gem install bundler. This currently installs 1.0.18
  • Install jruby-openssl: jruby -S gem install jruby-openssl. This currently installs 0.7.4.
  • Verify the gem is installed: it is listed by jruby -S gem list

  • Execute jruby -S bundle install while the :source in the Gemfile points to a gemserver available via https. The following exception is now raised:

    LoadError: OpenSSL::SSL requires the jruby-openssl gem
                  (root) at $HOME/bin/jruby/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/ssl.rb:8
                use_ssl= at $HOME/bin/jruby/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/ssl.rb:124
          connection_for at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:317
                 request at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:368
              fetch_http at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:203
                    send at org/jruby/RubyKernel.java:2104
              fetch_path at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:231
              load_specs at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:258
              load_specs at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/maven_gemify.rb:72
                    list at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:231
                    each at org/jruby/RubyArray.java:1603
                    list at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:227
                    list at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/maven_gemify.rb:63
    fetch_all_remote_specs at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:253
            remote_specs at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:234
                    each at org/jruby/RubyArray.java:1603
            remote_specs at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:231
             fetch_specs at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:165
                   specs at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:70
                   index at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:159
                    each at org/jruby/RubyArray.java:1603
                   index at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:158
                   build at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/index.rb:7
                   index at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:157
                 resolve at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:151
                   specs at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:90
       resolve_remotely! at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:85
                     run at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:41
                 install at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:8
                 install at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/cli.rb:220
                    send at org/jruby/RubyKernel.java:2092
                     run at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:21
             invoke_task at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/invocation.rb:118
                dispatch at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor.rb:263
                   start at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/base.rb:386
                  (root) at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/bin/bundle:13
                    load at org/jruby/RubyKernel.java:1063
                  (root) at $HOME/bin/jruby/bin/bundle:19
  • However, if you issue jruby -ropenssl -S bundle install, the command works just fine
Ivo Wever

To slightly thicken the plot:

  • if, after the steps above, you issue jruby -S bundle update (bundle install wouldn't try to download the gemserver index), it works just fine. The jruby-openssl from the bundle is now used. This can be shown by removing it (rm -rf vendor/bundle): afterwards, the command fails again.

This may be related to issue #10: I've seen the error mentioned in that issue occur when jruby-openssl was installed globally as well as in the bundle. When it tries to load the gem the second time, it lists a number of constant already defined warnings and then fails because of not finding jopenssl/version. This probably has to do with bundler munging the paths where gems are searched for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.