Ruby 2.4 on Mac OS Mojave : image not found ... related to openssl.bundle
Per the comment: Remove Ruby and reinstall.
Error loading RubyGems plugin ,openssl.bundle (LoadError)
Things to verify...
- How did you install rvm
- hit
rvm notes
and check if it's installed properly ruby -v
, check for the version of ruby present
If you find any issues here, uninstall rvm using rvm implode
and also remove ruby. Refer to the rvm installation guide for the use of this command.
\curl -L https://get.rvm.io | bash -s stable --ruby
OR you can try the other way without removing the present rvm installation.
rvm get stable
rvm reinstall 2.0.0
Hope this helps.
troubles with RVM and OpenSSL
Try this:
rvm get head
rvm pkg remove
rvm requirements run # if brew gives you warnings about formulas to install, run "brew install" for each before moving on.
rvm reinstall [the version you need (i.e: 2.0.0)]
mysql2: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib after homebrew update
OpenSSL 1.0 reached EOL on 2019-12-31
Reinstalling mysql2
gem with --with-cflags
and --with-ldflags
arguments pointing to openssl@1.1
fixed the error:
gem uninstall mysql2
gem install mysql2 -v 0.4.4 -- --with-cflags=\"-I/usr/local/opt/openssl@1.1/include\" --with-ldflags=\"-L/usr/local/opt/openssl@1.1/lib\"
bundle install
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Update: As of December 2020 and beyond, brew switch
does not work, so use the other answer by @angabriel:
brew install rbenv/tap/openssl@1.0
ln -sfn /usr/local/Cellar/openssl@1.0/1.0.2t /usr/local/opt/openssl
Original Answer:
Switch to an older openssl package
brew switch openssl 1.0.2s
Or, depending on your exact system configuration, you may need to switch to a different version. Check the output of ls -al /usr/local/Cellar/openssl
for the version number to switch to.
brew switch openssl 1.0.2q
# or
brew switch openssl 1.0.2r
# or
brew switch openssl 1.0.2s
# or
brew switch openssl 1.0.2t
# etc...
Library not loaded: /opt/local/lib/libssl.1.0.0.dylib (LoadError)
Your questions mentions three paths /opt/local
, /usr/local
and /etc/openssl
they belong to Macports, Homebrew and SM Framework respectively.
As the last one is used to build static rubies it is harmeless and not related to the problem. The other two suggest that you have switched from macports to homebrew between installing the rubies.
You need to reinstall ruby-2.0.0-p195
which is referring still the old paths from macports, you can do it with:
rvm reinstall ruby-2.0.0-p195
You can get more details about the rubies and openssl paths they use running:
rvm --debug osx-ssl-certs update all
dyld: Library not loaded ... Reason: Image not found
Find all the boost libraries (where exefile
is the name of your executable):
$ otool -L exefile
exefile:
@executable_path/libboost_something.dylib (compatibility version 0.7.0, current version 0.7.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 65.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
and for each libboost_xxx.dylib
, do:
$ install_name_tool -change @executable_path/libboost_something.dylib /opt/local/lib/libboost_something.dylib exefile
and finally verify using otool
again:
$ otool -L exefile
exefile:
/opt/local/lib/libboost_something.dylib (compatibility version 0.7.0, current version 0.7.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 65.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
Manpages: otool
install_name_tool
EDIT A while back I wrote a python script (copy_dylibs.py
) to work out all this stuff automatically when building an app. It will package up all libraries from /usr/local
or /opt/local
into the app bundle and fix references to those libraries to use @rpath
. This means you can easily install third-party library using Homebrew and package them just as easily.
I have now made this script public on github.
brew cannot find ANY packages
I had the same issue and I was able to solve it by running the doctor command and follow the steps which need to be updated there.
My homebrew-core was not at the master branch.
brew doctor
git -C $(brew --repo homebrew/core) checkout master
And that's it. After that, I was able to run the rbenv install command.
OpenSSL can't load library with gem rubygems or brew or bundle
Not sure why and how but :
rbenv install 2.1.2
rbenv: /usr/local/Cellar/rbenv/versions/2.1.2 already exists
continue with installation? (y/N) y
And now it works ! Just had to reinstall my ruby, like it did re-link openssl with it someway...
I can work again now, but just so I know more what happens, if someone know the under-the-hood mecanisms, I'll be glad to hear it.
Related Topics
How to Ignore File Types in a Web Crawler
What Is an Eoferror in Ruby File I/O
Permanently Switching User in Capistrano 3 (Separate Authorization & Deploy)
Ruby on Rails - Add Condition on ':Include =>' to Load Limited Number of Objects
Nameerror: Undefined - Have Parsing Rules for Local Variables Changed in Ruby 2.1.2
How to Find the Most Recently Modified Folder in a Directory Using Ruby
Rspec -- Test If Method Called Its Block Parameter
Array#Uniq with Block Equivalent in Ruby 1.8.7
How to Access Text Field in an Iframe
Searching from a Range of Ids in Activerecord
How to Dynamically Create Instance Methods at Runtime
Gem Install Wrong Number of Arguments (Given 4, Expected 1)
Ruby on Rails - Paperclip Not Saving to Database
How to Convert This Ruby String into an Array
How to Check If a Resource Exists in an Aws S3Bucket
Gem::Ext::Builderror: Error: Failed to Build Gem Native Extension. on Cenos 6.5