Installing via HTTPS fails when using JRuby #1621
Comments
Seems like we should add something that conditionally tries to require OpenSSL if we're running on jruby. On Jan 12, 2012, at 3:04 AM, cfbrobakreply@reply.github.com wrote:
|
I probably should add that it only fails if option "--path" and/or "--deployment" is used, that is, when BUNDLE_PATH is set to something different from the system repository. |
It is possible to work around this issue by changing the source to use http instead of https |
Can replicate on bundler 1.1.0 and JRuby 1.6.7. |
I'm a noobie, so I'm not sure if this is a new issue or old. I'm using the RubyMine 4.02 IDE. \jruby-1.6.5.1\bin\jruby.exe C:\jruby-1.6.5.1\bin/bundle install jruby-openssl Process finished with exit code 1 |
This bit me today, would love a fix. |
I can replicate with bundler 1.1.3 and JRuby 1.6.7. It works if I just run |
I can replicate with bundler 1.1.3 and 1.0.22. It worked when using http |
Can also replicate (Bundler 1.1.3, JRuby 1.6.7). For those of us with private gem repositories that must be accessed over https, a workaround is to avoid the |
if you require openssl beforehand (and has jruby-openssl installed) it works:
|
@carlhoerberg Best workaround so far. Thank you! |
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>
Still seeing this issue. JRuby 1.6.5 in 1.9 mode. Bundler v. 1.1.5. |
@dhruvbansal Yup, it's still the same as it's always been. :P |
ee48b35 should fix this issue, if it's still not working leaving a comment and I'll reopen the issue. |
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>
Environment
Problem
Even though gem "jruby-openssl" is installed alongside "bundler" in the system repository it is not found when running "bundle install " and having HTTPS in the source definition. The command fails fails with:
My guess is that Bundler changes the Gem.path before the "require 'openssl'" is issued. If I add a "require 'openssl'" to the Bundler launch script, it works.
I have also tried using Bundler 1.1.rc.7 and the problem is the same.
The text was updated successfully, but these errors were encountered: