ruby – 未定义的符号:运行bundle install时的SSLv2_method

前端之家收集整理的这篇文章主要介绍了ruby – 未定义的符号:运行bundle install时的SSLv2_method前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在运行bundler安装我的宝石时遇到此错误.我环顾四周找不到解决办法,除了在rvm上安装openssl pkg并重新安装所有ruby,这样做没有解决问题,还有其他可能的解决方案吗?

这是我运行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>'

解决方法

我做了以下操作并修复了问题:
$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
原文链接:https://www.f2er.com/ruby/268349.html

猜你在找的Ruby相关文章