JRuby-openssl breaks Ruby MRI #15

Agiley opened this Issue Jan 30, 2012 · 3 comments


None yet
2 participants

Agiley commented Jan 30, 2012


I do my development in Ruby MRI (1.9.3-p0) and deploy using JRuby. This has worked fine so far but since a few days ago this is no longer working - which I highly believe is due to JRuby-openssl 0.7.5.

When I run rails console, run a rake task etc I get the following error: https://gist.github.com/0f012595f60e7bf71f67 .

Somehow JRuby-openssl is loaded even though it's MRI and can't locate jopenssl (jruby-openssl-0.7.5/lib/shared/openssl.rb:10 ).

Steps to reproduce:

  1. rvm use 1.9.3-p0@jruby_bug_test --create
  2. gem install rails
  3. rails new jruby_bug_test && cd jruby_bug_test
  4. Use the following Gemfile: https://gist.github.com/5164e2e2dd24e380b9fd
  5. rm -rf Gemfile.lock && bundle install
  6. rails console

It's the gem majestic_seo_api that's pulling in JRuby-openssl. See it's Gemfile here: https://gist.github.com/251be3c1ca1badebd9d3

Is this just happening for me or anyone else doing dev on MRI and deploys on JRuby running into this issue?

Agiley commented Jan 31, 2012

Appears as this actually was a gem issue with Majestic SEO API (a gem I wrote myself :P) since Jeweler generated a gemspec-file that pulled in JRuby-openssl. Guess I learned something new :)

Agiley closed this Jan 31, 2012


nicksieger commented Feb 1, 2012

What happens if you put that line in your own gemfile?

gem 'jruby-openssl', '~> 0.7', :platforms => :jruby

Agiley commented Feb 1, 2012

JRuby-openssl was pulled in due to the fact that the gem (Majestic SEO API) had it specified as a dependency in its gemspec. I had

gem 'jruby-openssl', '~> 0.7', :platforms => :jruby

specified in the Gemfile for the gem and I used jeweler for generating the gemspec. Somehow Jeweler didn't understand that JRuby-openssl was JRuby-specific and pulled it in anyway as a gem dependency. I've fixed the invalid gemspec and everything's fine now - I can develop in MRI 1.9.3 and deploy in JRuby 1.6.6 - totally sweet :). Thanks for all the work you've put into JRuby Nick.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment