trying to solve /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (LoadError) led to bad interpreter: /usr/local/opt/python/bin/python2.7

梦想与她 提交于 2020-12-04 05:26:32

问题


  1. After a brew upgrade, I couldn’t run any of my Ruby on Rails apps anymore. I got this error message:

    : dlopen(/Users/ll/.rbenv/versions/2.6.2/lib/ruby/2.6.0/x86_64-darwin18/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (LoadError) Referenced from: /Users/ll/.rbenv/versions/2.6.2/lib/ruby/2.6.0/x86_64-darwin18/openssl.bundle Reason: image not found - /Users/ll/.rbenv/versions/2.6.2/lib/ruby/2.6.0/x86_64-darwin18/openssl.bundle

  2. So I tried

brew switch openssl 1.0.2t

solution sugests here https://stackoverflow.com/a/59184347/11410556 But couldn't find openssl 1.0.2t, my version was openssl@1.1 1.1.1h

  1. Then I tried

brew uninstall --ignore-dependencies openssl brew tap-new $USER/old-openssl brew extract --version=1.0.2t openssl $USER/old-openssl brew install openssl@1.0.2t ln -s /usr/local/Cellar/openssl@1.0.2t/1.0.2t /usr/local/opt/openssl

suggest here: https://stackoverflow.com/a/64479513/11410556. But when I ran

brew switch openssl 1.0.2t

I got this Error:

openssl does not have a version “1.0.2t” in the Cellar.
openssl’s installed versions
  1. So I went for this solution

    brew unlink openssl@1.1 brew link openssl@1.0.2t

And then get:

Warning: Refusing to link macOS provided/shadowed software: openssl@1.0.2t
If you need to have openssl@1.0.2t first in your PATH run:
 echo ‘export PATH=“/usr/local/opt/openssl@1.0.2t/bin:$PATH”’ >> ~/.zshrc
For compilers to find openssl@1.0.2t you may need to set:
 export LDFLAGS=“-L/usr/local/opt/openssl@1.0.2t/lib”
 export CPPFLAGS=“-I/usr/local/opt/openssl@1.0.2t/include”
For pkg-config to find openssl@1.0.2t you may need to set:
 export PKG_CONFIG_PATH=“/usr/local/opt/openssl@1.0.2t/lib/pkgconfig”  
  1. I ran the first choice :

    echo 'export PATH="/usr/local/opt/openssl@1.0.2t/bin:$PATH"' >> ~/.zshrc

restart my server and now I have

omz_urlencode:2: /usr/local/bin/pygmentize: bad interpreter: /usr/local/opt/python/bin/python2.7: no such file or directory (edited) 

Whatever I do.

  1. I'm not used to try things I don't understand and I think I went too far. I would be very grateful for any help to get out of this mess.

回答1:


For those who would have the same problem, here's how I finally fixed it.

Regarding the Python2 error message, I set Python3 as a default Python with :

ln -s -f /usr/local/bin/python3.9 /usr/local/bin/python

As suggested here: https://dev.to/malwarebo/how-to-set-python3-as-a-default-python-version-on-mac-4jjf

The, the error message has disappeared.

Regarding the openssl problem:

I installed the last ruby version 2.7.2 with rbenv, and upgraded my app. Then I had a PG::ConnectionBad error.

I ran

brew postgresql-upgrade-database.

And now I’s working fine.

The simple solution suggested here put me on the way.

Thanks anothermh for your support.



来源:https://stackoverflow.com/questions/64647660/trying-to-solve-usr-local-opt-openssl-lib-libssl-1-0-0-dylib-loaderror-led-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!