Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

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

Closed
shivanibhanwal opened this issue Jun 20, 2012 · 3 comments
Closed

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

shivanibhanwal opened this issue Jun 20, 2012 · 3 comments

Comments

@shivanibhanwal
Copy link

When I try to create a new rails app in rails 3.2.6 and ruby 1.9.3. I am getting theis error when it starts "bundle install"

LoadError: OpenSSL::SSL requires the jruby-openssl gem
(root) at /Volumes/dream2/torquebox-current/jruby/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/ssl.rb:8
use_ssl= at /Volumes/dream2/torquebox-current/jruby/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/ssl.rb:124
ssl at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/net/http/persistent.rb:448
connection_for at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/net/http/persistent.rb:216
request at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/net/http/persistent.rb:358
fetch at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/fetcher.rb:135
fetch_dependency_remote_specs at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/fetcher.rb:163
fetch_remote_specs at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/fetcher.rb:122
specs at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/fetcher.rb:70
remote_specs at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/source.rb:234
each at org/jruby/RubyArray.java:1615
remote_specs at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/source.rb:232
fetch_specs at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/source.rb:165
specs at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/source.rb:70
index at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/definition.rb:205
each at org/jruby/RubyArray.java:1615
index at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/definition.rb:202
build at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/index.rb:9
index at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/definition.rb:198
resolve at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/definition.rb:192
specs at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/definition.rb:127
resolve_remotely! at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/definition.rb:122
run at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/installer.rb:46
install at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/installer.rb:12
install at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/cli.rb:220
send at org/jruby/RubyKernel.java:2076
run at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/thor/task.rb:21
invoke_task at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/thor/invocation.rb:118
dispatch at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/thor.rb:263
start at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/thor/base.rb:386
(root) at /Users/shivanithakur/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.3/bin/bundle:13
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
Fetching gem metadata from https://rubygems.org/.Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Please include the full output of the command, your Gemfile and Gemfile.lock. Thanks!

@indirect
Copy link
Member

Change the "https" in your Gemfile's source line to "http". Unfortunately Bundler cannot currently connect to gem sources over HTTPS on jRuby, due to the way jRuby packages SSL as a separate gem.

@shivanibhanwal
Copy link
Author

Thank you for the quick response.

davidcelis pushed a commit to davidcelis/bundler that referenced this issue Aug 23, 2012
By default, most Gemfiles use https://rubygems.org/ as their source, and
rightly so. SSL is a good default to maintain. However, bundling on the
JRuby platform has had issues for a long time now, usually throwing
`LoadError: OpenSSL::SSL requires the jruby-openssl gem`. This is a
problem I see repeatedly on Rails applications generated under JRuby,
despite having `gem 'jruby-openssl'` in the Gemfile. Bundler dies before
the gem can be installed, however; even having `jruby-openssl`
preinstalled would fail.

This patch adds a `require` statement for `'openssl'` in the place that
seemed most logical to me, `lib/bundler/fetcher.rb`. After adding this
require statement, bundling via HTTPS has worked flawlessly.

Fixes issues rubygems#1621, rubygems#1819, rubygems#1975 (closed), and rubygems#1996 (closed).

Signed-off-by: David Celis <david@davidcelis.com>
brettporter pushed a commit to brettporter/bundler that referenced this issue Nov 28, 2012
By default, most Gemfiles use https://rubygems.org/ as their source, and
rightly so. SSL is a good default to maintain. However, bundling on the
JRuby platform has had issues for a long time now, usually throwing
`LoadError: OpenSSL::SSL requires the jruby-openssl gem`. This is a
problem I see repeatedly on Rails applications generated under JRuby,
despite having `gem 'jruby-openssl'` in the Gemfile. Bundler dies before
the gem can be installed, however; even having `jruby-openssl`
preinstalled would fail.

This patch adds a `require` statement for `'openssl'` in the place that
seemed most logical to me, `lib/bundler/fetcher.rb`. After adding this
require statement, bundling via HTTPS has worked flawlessly.

Fixes issues rubygems#1621, rubygems#1819, rubygems#1975 (closed), and rubygems#1996 (closed).

Signed-off-by: David Celis <david@davidcelis.com>
@nilbus
Copy link

nilbus commented Feb 11, 2013

Despite having no https URLs in my Gemfile, I was getting this error. Installing the latest bundler (1.3.0.pre.7) resolved the issue for me.

gem install --pre bundler

Thanks for the fix @davidcelis

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

No branches or pull requests

3 participants