Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rake db:migrate error with mysql2 gem - Library not loaded: libssl.1.0.0.dylib

Getting the following error after running rake db:migrate

rake aborted!
LoadError: dlopen(/Users/scott/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/mysql2-0.4.10/lib/mysql2/mysql2.bundle, 9): Library not loaded: libssl.1.0.0.dylib
  Referenced from: /Users/scott/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/mysql2-0.4.10/lib/mysql2/mysql2.bundle
  Reason: image not found - /Users/scott/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/mysql2-0.4.10/lib/mysql2/mysql2.bundle
/Users/scott/Google Drive/playground/myApp/myApp/config/application.rb:21:in `<top (required)>'
/Users/scott/Google Drive/playground/myApp/myApp/Rakefile:4:in `<top (required)>'

What does the libssl refer to?

like image 304
s89_ Avatar asked Jul 10 '18 11:07

s89_


2 Answers

So the answer to my own question was the following - out of the 5 or so other solutions on stackoverflow, this is the only one that worked:

brew install openssl

cd /usr/local/Cellar/openssl/1.0.1f/lib

sudo cp libssl.1.0.0.dylib libcrypto.1.0.0.dylib /usr/lib/

Full solution here - https://mithun.co/hacks/library-not-loaded-libcrypto-1-0-0-dylib-issue-in-mac/

like image 61
s89_ Avatar answered Oct 12 '22 09:10

s89_


just one command:

gem pristine mysql2

then i fix this problem

like image 33
Cool.wen Avatar answered Oct 12 '22 09:10

Cool.wen