Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

LoadError: OpenSSL::SSL requires the jruby-openssl gem #2

Open
solidline opened this issue Jan 27, 2012 · 15 comments · Fixed by #21
Open

LoadError: OpenSSL::SSL requires the jruby-openssl gem #2

solidline opened this issue Jan 27, 2012 · 15 comments · Fixed by #21

Comments

@solidline
Copy link

Created a new rails app rails new jetpack. Added the jetpack gem and config/jetpack.yml to the new rails application. Ran bundle exec jetpack . inside the rails app.

Resulted in the following:


LoadError: OpenSSL::SSL requires the jruby-openssl gem
                         (root) at file:/Users/tsanden/repos/jetpack/vendor/jruby.jar!/META-INF/jruby.home/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/ssl.rb:8
                            ssl at file:/Users/tsanden/repos/jetpack/vendor/jruby.jar!/META-INF/jruby.home/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/ssl.rb:451
                 connection_for at /Users/tsanden/repos/jetpack/vendor/bundler_gem/gems/bundler-1.1.rc/lib/bundler/vendor/net/http/persistent.rb:216
                        request at /Users/tsanden/repos/jetpack/vendor/bundler_gem/gems/bundler-1.1.rc/lib/bundler/vendor/net/http/persistent.rb:358
                          fetch at /Users/tsanden/repos/jetpack/vendor/bundler_gem/gems/bundler-1.1.rc/lib/bundler/fetcher.rb:135
  fetch_dependency_remote_specs at /Users/tsanden/repos/jetpack/vendor/bundler_gem/gems/bundler-1.1.rc/lib/bundler/fetcher.rb:160
             fetch_remote_specs at /Users/tsanden/repos/jetpack/vendor/bundler_gem/gems/bundler-1.1.rc/lib/bundler/fetcher.rb:122
                          specs at /Users/tsanden/repos/jetpack/vendor/bundler_gem/gems/bundler-1.1.rc/lib/bundler/fetcher.rb:70
                   remote_specs at /Users/tsanden/repos/jetpack/vendor/bundler_gem/gems/bundler-1.1.rc/lib/bundler/source.rb:230
                           each at org/jruby/RubyArray.java:1612


...

'cd . && PATH=$PATH:$(dirname $0) GEM_HOME="file:/Users/tsanden/repos/jetpack/vendor/jruby.jar!/META-INF/jruby.home/lib/ruby/gems/1.8" GEM_PATH="file:/Users/tsanden/repos/jetpack/vendor/jruby.jar!/META-INF/jruby.home/lib/ruby/gems/1.8:vendor/bundler_gem" exec java -Xmx2048m -jar vendor/jruby.jar --1.9  -e 'require "rubygems"; require "bundler"; require "bundler/cli"; cli=Bundler::CLI.new; cli.options={:deployment=>true}; cli.install'' failed.

I'm also using rbenv, not sure if this is causing issues.

@xaviershay
Copy link
Contributor

Try adding to your Gemfile

platform :jruby do
  gem 'jruby-openssl'
end

If that fixes, I'll add to the README as a requirement. Don't think we can add jruby only dependencies to a gem.

@solidline
Copy link
Author

Sadly this did not work. Thanks for the response though!

@xaviershay
Copy link
Contributor

:( I'll try harder on the weekend.

@cobrien
Copy link

cobrien commented Feb 15, 2012

Having the same issue while trying to play with Jetpack -- created a new Rails app for testing, added the jetpack gem to Gemfile, and configured jetpack.yml. Executed bundle exec jetpack . using on MRI (as referenced the README) Ruby 1.9.2 via RVM. Tried adding:

platform :jruby do
  gem 'jruby-openssl'
end

to the Gemfile ... still no joy.

@xaviershay
Copy link
Contributor

Oh so I think what you have to do is run bundler using JRuby at least once so that java becomes listed as a platform in your Gemfile.lock. If you only ever run it with MRI, it will never include jruby-openssl in the lock file.

@cchandler
Copy link

@sconover and I just encountered this problem internally. For us it was because the Gemfile specified a source of "https://rubygems.org" and as soon as we just used plain http it worked like a champ.

@mrgcohen
Copy link

@cchandler that did it for me too

@jeberly
Copy link

jeberly commented Jul 22, 2012

@cchandler Thanks!

@westonplatter
Copy link

@cchandler +1. http worked for me too.

@debugging
Copy link

Hi, I'm getting this issue also :)

I think I know the issue, but I'm still a bit confused. I'm using rvm with jruby 1.7.4, but the gem only loads jetpack when using MRI.

So I should create a new rvm layout using MRI and use that soley for the purposes of building? I guess people use this for production builds only and not for development b/c of the constant switching of rubies?

@debugging
Copy link

@cchandler what do you mean 'just used plain http', my gemfile.lock has remote: https://rubygems.org/, what should I be doing to use http?

@mrgcohen
Copy link

mrgcohen commented Jul 2, 2013

top of Gemfile

source 'http://rubygems.org'

On Sun, Jun 9, 2013 at 1:56 PM, Salman Ahmed notifications@github.comwrote:

@cchandler https://github.com/cchandler what do you mean 'just used
plain http', my gemfile.lock has remote: https://rubygems.org/, what
should I be doing to use http?


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-19170341
.

@debugging
Copy link

thanks that worked.

@manish-m
Copy link

I already have source 'http://rubygems.org' instead of 'https' in Gemfile, but I still get the same error

@tsyber1an
Copy link

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants