Help us understand the problem. What is going on with this article?

[MEMO] gem コマンドで Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib が出たときの対処法

foreman動かしたいからgemを叩いたら怒られた案件;

$ gem install foreman
ERROR:  Loading command: install (LoadError)
    dlopen(/Users/suzukalight/.rbenv/versions/2.6.2/lib/ruby/2.6.0/x86_64-darwin16/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /Users/suzukalight/.rbenv/versions/2.6.2/lib/ruby/2.6.0/x86_64-darwin16/openssl.bundle
  Reason: image not found - /Users/suzukalight/.rbenv/versions/2.6.2/lib/ruby/2.6.0/x86_64-darwin16/openssl.bundle
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

結論としては、rbenvでいったんuninstallしてからinstallしなおす。そうするとopenssl向けのライブラリを再度構成してくれるっぽい;

$ rbenv uninstall 2.6.2
$ rbenv install 2.6.2
Downloading openssl-1.1.1d.tar.gz...

$ gem install foreman

(ここでターミナルを起こし直す)

$ foreman start -f Procfile.app.dev

ちなみに brew update && brew upgrade もやったけど、こちらは効果がなかった。

reference: https://teratail.com/questions/225461

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away