8

I'm getting this error when running bundler to install my gems. I've looked around and find no solution to it except installing the openssl pkg on rvm and reinstalling all rubies, doing so did not fix the issue, are there any other possible solutions?

This is the output I get running bundle install:

Fetching gem metadata from https://rubygems.org/.Unfortunately, a fatal error has occurred. Please see the Bundler 
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks! 
/home/octavius/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': /home/octavius/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-linux/openssl.so: undefined symbol: SSLv2_method - /home/octavius/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-linux/openssl.so (LoadError)
    from /home/octavius/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/octavius/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/openssl.rb:17:in `<top (required)>'
    from /home/octavius/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/octavius/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/octavius/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/https.rb:22:in `<top (required)>'
    from /home/octavius/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/octavius/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/vendor/net/http/persistent.rb:447:in `ssl'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/vendor/net/http/persistent.rb:216:in `connection_for'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/vendor/net/http/persistent.rb:358:in `request'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/fetcher.rb:149:in `fetch'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/fetcher.rb:177:in `fetch_dependency_remote_specs'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/fetcher.rb:135:in `fetch_remote_specs'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/fetcher.rb:73:in `specs'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/source.rb:234:in `block in remote_specs'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/source.rb:232:in `each'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/source.rb:232:in `remote_specs'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/source.rb:165:in `fetch_specs'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/source.rb:70:in `specs'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/lazy_specification.rb:53:in `__materialize__'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/spec_set.rb:86:in `block in materialize'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/spec_set.rb:83:in `map!'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/spec_set.rb:83:in `materialize'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/definition.rb:113:in `specs'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/definition.rb:108:in `resolve_remotely!'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/installer.rb:81:in `run'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/installer.rb:14:in `install'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/cli.rb:230:in `install'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/vendor/thor/task.rb:27:in `run'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/vendor/thor.rb:275:in `dispatch'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/vendor/thor/base.rb:408:in `start'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/bin/bundle:14:in `block in <top (required)>'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/lib/bundler/friendly_errors.rb:4:in `with_friendly_errors'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.1/bin/bundle:14:in `<top (required)>'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/bin/bundle:19:in `load'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125@global/bin/bundle:19:in `<main>'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125/bin/ruby_noexec_wrapper:14:in `eval'
    from /home/octavius/.rvm/gems/ruby-1.9.3-p125/bin/ruby_noexec_wrapper:14:in `<main>'
8vius
  • 5,786
  • 14
  • 74
  • 136
  • Your question is too vague. Is it just bundler giving this error message or is it generated when bundler tries to install one of the gems in the gemfile? I.e. is the error coming from a specific gem being installed, or from bundler itself. If it's from a specific gem start by narrowing down which gem is the cause. You can seldom solve bugs with a shotgun approach. Best approach is always to narrow down and focus the problem. – Casper Oct 06 '12 at 11:54
  • This came up as first hit on a google search: http://stackoverflow.com/questions/8206546/undefined-symbol-sslv2-method/8219807#8219807 . However I would still vote to narrow down the real cause first. – Casper Oct 06 '12 at 11:59
  • Yes it came up, but there's no answer to the issue on that question, it's more like simply explaining why it happens. – 8vius Oct 06 '12 at 12:34
  • Did you try cleaning out your `.rvm` (`rm -rf ~/.rvm`), reinstalling, and then installing `rvm pkg install openssl`? So many times I see rvm problems because once you install something and try reinstalling it doesn't load properly because of old libraries remaining in the rvm tree. I'm guessing you tried it, but just making sure. If you didn't do `rm -rf ~/.rvm` then try it with that step included. – Casper Oct 06 '12 at 13:19
  • You could also try installing openssl from source system-wide yourself with ssl2 enabled. However perhaps as a last step since you could potentially break some stuff (although it would be fixed by reinstalling the original openssl rpm package). Anyway it shouldn't be rocket science: you have an openssl lib somewhere that does NOT have ssl2 compiled into it and ruby is loading that lib. That's why it's easiest to clean out your .rvm tree and start again. – Casper Oct 06 '12 at 13:25
  • can you explain how I can do that? Yes, I installed pkg openssl and I still have the same problem. – 8vius Oct 07 '12 at 03:19

1 Answers1

12

I did the following and it fixed the issue:

$ source ~/.rvm/scripts/rvm
$ rvm pkg install zlib
$ rvm pkg install openssl
$ sudo apt-get install libreadline-dev
$ rvm pkg install readline
$ rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr
$ gem install rails
8vius
  • 5,786
  • 14
  • 74
  • 136
  • 1
    One problem I've had with this solution is that I ran into problems installing the pg gem. I found this article allowed me to fix the problems and still install the pg gem: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/ – chaostheory Oct 30 '12 at 20:54