LoginSignup
5
13

More than 5 years have passed since last update.

gem install の invoke_with_build_args のエラー 対処方法

Posted at

問題

久しぶりにrubyを触ることになり、gem install を行ったところ、下記のエラーが発生。結構はまったので対処方法を簡単に残す。

terminal
ERROR:  Loading command: install (LoadError)
    dlopen(~/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle, 9): Symbol not found: _SSLv2_client_method
  Referenced from: ~/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle
  Expected in: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
 in ~/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle - ~/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle
ERROR:  While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass

解決方法

いろいろと試した結果、下記のリンクコマンドで解決した。

terminal
brew update
brew install openssl
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/Cellar/openssl/1.0.2j/bin/openssl /usr/local/bin/openssl

opensslがすでにインストールされていたので、
brew uninstall --force --ignore-dependencies openssl
で一旦むりやりをアンイストールして、から再度インストールした。
アンイストールは不要だったかも。
リングコマンド3つめの1.0.2jは各々の環境によって変更する必要あり。

参考

http://qiita.com/YoshiyukiKato/items/e4f67c588d2943c1253d
https://stackoverflow.com/questions/38670295/homebrew-refusing-to-link-openssl

5
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
13