webmock for jruby requires jruby-openssl to specified in bundler #91

btatnall opened this Issue May 4, 2011 · 4 comments

3 participants


Webmock causes OpenSSL to autoload in jruby.

lib/ruby/site_ruby/shared/jruby/openssl/autoloads/ssl.rb:29:in `initialize_with_webmock'

If jruby-openssl is not specified in the Gemfile then requiring fails. webmock should list jruby-openssl as a dependency for jruby.


If WebMock were to list jruby-openssl as a runtime dependency, it would cause problems for people using WebMock on non-JRuby interpreters (such as MRI). Here's an example of an error you will get--in this case it was because relish 0.2.3 listed jruby-openssl as a runtime dependency.

Unfortunately, the gemspec does not support per-interpreter dependency declaration.


Would you be willing to publish a webmock-jruby similar to mongrel-jruby?


Bartosz will have to decide if he wants to maintain two separate releases. I think it makes sense for gems with native components (like nokogiri). For a pure ruby gem like webmock it seems like overkill.

Instead, I think we could add some code that checks the ruby interpreter at runtime, attempts to require jruby-openssl, and prints a warning if it that fails, explaining that users need to install jruby-openssl on jruby.

Would that be sufficient? Care to provide a patch?


Until we can find someone to maintain a webmock-jruby I'm closing this one.

@jcf jcf closed this May 28, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment