未找到 Ruby 捆绑符号:_SSLv2_client_method (LoadError)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25492787/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Ruby Bundle Symbol not found: _SSLv2_client_method (LoadError)
提问by Lenek
I was doing attempting to do some updates to openssl using homebrew and I somehow managed to break everything. I can't do anything now, this is what I get when I try to do bundle install:
我正在尝试使用自制软件对 openssl 进行一些更新,但我以某种方式设法打破了一切。我现在什么也做不了,这就是我尝试进行捆绑安装时得到的结果:
$ bundle install
/Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': dlopen(/Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle, 9): Symbol not found: _SSLv2_client_method (LoadError)
Referenced from: /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle
Expected in: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
in /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle - /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/openssl.rb:17:in `<top (required)>'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/security.rb:11:in `<top (required)>'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/package.rb:43:in `<top (required)>'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/dependency_installer.rb:3:in `<top (required)>'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/installer.rb:2:in `<top (required)>'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/cli/install.rb:78:in `run'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/cli.rb:146:in `install'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/vendor/thor/command.rb:27:in `run'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/vendor/thor/invocation.rb:121:in `invoke_command'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/vendor/thor.rb:363:in `dispatch'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/vendor/thor/base.rb:440:in `start'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/cli.rb:9:in `start'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/bin/bundle:20:in `block in <top (required)>'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/bin/bundle:20:in `<top (required)>'
from /Users/asServer/.rbenv/versions/2.1.2/bin/bundle:23:in `load'
from /Users/asServer/.rbenv/versions/2.1.2/bin/bundle:23:in `<main>'
回答by Ryan Dlugosz
I just fixed a similar issue on my system. You need to rebuild your install of Ruby 2.1.2 and it will re-link against the newly-updated SSL.
我刚刚在我的系统上修复了一个类似的问题。您需要重新安装 Ruby 2.1.2,它会重新链接到新更新的 SSL。
$ rbenv install 2.1.2
rbenv: /Users/ryan/.rbenv/versions/2.1.2 already exists
continue with installation? (y/N) y
Downloading ruby-2.1.2.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/f22a6447811a81f3c808d1c2a5ce3b5f5f0955c68c9a749182feb425589e6635
Installing ruby-2.1.2...
Installed ruby-2.1.2 to /Users/ryan/.rbenv/versions/2.1.2
回答by Sandeep M
I had a similar issue after upgrading openssl. I use rvm. I stared by upgrading rvm.
升级 openssl 后我遇到了类似的问题。我用rvm。我盯着升级rvm。
$ rvm get stable
I next reinstalled 1.9.3.
我接下来重新安装了 1.9.3。
rvm reinstall ruby-1.9.3-p545
After reinstalling, I ran:
重新安装后,我运行:
$ rvm gemset pristine
If you see any errors restoring your gemset, your best option will be to empty the gemset and rebuild it.
如果您在恢复 gemset 时看到任何错误,最好的选择是清空 gemset 并重建它。
rvm gemset use mygemset
rvm gemset empty mygemset
gem install bundler
bundle install
If you have multiple gemsets, you will have to repeat these steps for each one of them.
如果您有多个 gemset,则必须为每个 gemset 重复这些步骤。
回答by Jerome
Have same issue for 1.9.3-p547, under rvm
在 rvm 下,1.9.3-p547 有同样的问题
rvm reinstall ruby-1.9.3-p547
Ruby gets re-installed, but fails in setting up a gemset_pristinefor the application because
Ruby 重新安装,但无法gemset_pristine为应用程序设置 a ,因为
libv8 version 3.16.14.3 failed
which was the reason I got to this point in the first place. Vicious frustration circle...
这就是我一开始就走到这一步的原因。恶性挫折圈...
update
Check your platform version. I have for example Darwin 10.8 and that is not listed here.
So, unless your version of the libv8 gem has a precompiled binary for your platform, it is going to take a long (long-long) time. Go out for dinner, a movie, chill out... If enough ask, maybe they'll set up a binary distro...
更新
检查您的平台版本。例如,我有 Darwin 10.8,此处未列出。因此,除非您的 libv8 gem 版本具有适用于您平台的预编译二进制文件,否则将需要很长时间(很长时间)。出去吃晚饭,看电影,放松一下……如果问得够多,也许他们会建立一个二进制发行版……
回答by DaveWoodall.com
Had the same error and solved it by brew upgrade openssl
有同样的错误并解决了 brew upgrade openssl
回答by Ralph Cowling
You might be a dork like me, with multiple openssl's
你可能和我一样是个笨蛋,有多个 openssl
I had the same issue for 2.1.2 and Ryan Dlugosz's excellent answer didn't go far enough. My problem was that I had multiple versions of openssl installed (I think I'd installed through brewandgitin previous projects).
我在 2.1.2 中遇到了同样的问题,而 Ryan Dlugosz 的出色回答还远远不够。我的问题是,我的OpenSSL的多个版本安装(我想我会通过安装brew和git在以前的项目)。
I had to delete /opt/local/bin/openssl and then rebuild 2.1.2.
我不得不删除 /opt/local/bin/openssl 然后重建 2.1.2。
Check global rbenv ruby
检查全局 rbenv ruby
$ rbenv global
2.1.2
Check openssl
检查openssl
$ which -a openssl
/opt/local/bin/openssl
/opt/local/bin/openssl
/usr/bin/openssl
Kill off duplicate openssl
杀死重复的openssl
$ sudo rm -rf /opt/local/bin/openssl
Rebuild 2.1.2
重建 2.1.2
$ rbenv install -f 2.1.2
Downloading openssl-1.0.1g.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/53cb818c3b90e507a8348f4f5eaedb05d8bfe5358aabb508b7263cc670c3e028
Installing openssl-1.0.1g...
Installed openssl-1.0.1g to /Users/globber/.rbenv/versions/2.1.2
Downloading ruby-2.1.2.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/f22a6447811a81f3c808d1c2a5ce3b5f5f0955c68c9a749182feb425589e6635
Installing ruby-2.1.2...
Installed ruby-2.1.2 to /Users/globber/.rbenv/versions/2.1.2
回答by Hajime
When did not solve problem at all, I suggest deleting RVM. And reinstall RVM and Rails.
当根本没有解决问题时,我建议删除RVM。并重新安装 RVM 和 Rails。
deleting RVM
删除 RVM
installing RVM, Rail
安装 RVM,导轨
$ curl -L https://get.rvm.io| bash -s
$ rvm get stable
$ rvm requirements
$ rvm install 2.0.0 --with-openssl-dir=$HOME/.rvm/usr
$ rvm use 2.0.0 $ gem update --system 2.0.3
$ gem install rails --version 4.0.5
$ curl -L https://get.rvm.io| bash -s
$ rvm 获得稳定
$ rvm 要求
$ rvm install 2.0.0 --with-openssl-dir=$HOME/.rvm/usr
$ rvm use 2.0.0 $ gem update --system 2.0.3
$ gem install rails --版本 4.0.5
回答by dechimp
rbenv users:
rbenv 用户:
It helps to make sure that you are using the right version of ruby. If you reinstall rbenv or install a new ruby, change to the ruby version you just installed:
它有助于确保您使用的是正确版本的 ruby。如果重新安装 rbenv 或安装新的 ruby,请更改为刚刚安装的 ruby 版本:
$ rbenv local 2.1.3
$ rbenv 本地 2.1.3
回答by lafeber
In case it might help anyone: I had a newer version of Ruby installed (2.1.2), and in my .ruby-version file I referenced the old one (2.0.0-p353)
如果它可能对任何人有帮助:我安装了较新版本的 Ruby (2.1.2),并且在我的 .ruby-version 文件中我引用了旧版本 (2.0.0-p353)
Changing my .ruby-version file to 2.1.2 fixed the issue for me.
将我的 .ruby-version 文件更改为 2.1.2 为我解决了这个问题。
回答by Catharz
I had a similar problem, which occurred after upgrading to ruby 2.2.2. However, my environment is a little different causing the above solutions to not work.
我有一个类似的问题,是在升级到 ruby 2.2.2 后发生的。但是,我的环境有点不同,导致上述解决方案不起作用。
I'm using:
我正在使用:
- OSX Yosemite (10.10.4)
- chruby
- ruby-install
- openssl (installed via homebrew)
- OSX 优胜美地 (10.10.4)
- 红宝石
- 红宝石安装
- openssl(通过自制软件安装)
The following command(s) resolved this in my situation:
在我的情况下,以下命令解决了这个问题:
> sudo ruby-install -r /opt/rubies ruby 2.2.2 -- --with-openssl-dir=/usr/local/opt/openssl
> gem install bundler
> bundler install
回答by adairdavid
In addition to the acceptance answers above, you may have to tell rbenv to use the newly installed version. For example, I had the old version in ~/.rbenv/version, so rbenv was always using the old one. Manually setting the new version in that file (or through the command line) should fix the problem.
除了上面的接受答案之外,您可能还需要告诉 rbenv 使用新安装的版本。例如,我在 ~/.rbenv/version 中有旧版本,所以 rbenv 总是使用旧版本。在该文件中手动设置新版本(或通过命令行)应该可以解决问题。
rbenv install -f 2.1.2
rbenv versions
rbenv global 2.1.2 //sets global version to 2.1.2

