Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails - Library not loaded: @@HOMEBREW_PREFIX@@/opt/openssl/lib/libssl.1.0.0.dylib (LoadError)

I am fighting with an error that occurs when I run rails s:

/Users/adam/.rvm/gems/ruby-2.0.0-p481/gems/mysql2-0.3.16/lib/mysql2.rb:8:in `require': dlopen(/Users/adam/.rvm/gems/ruby-2.0.0-p481/extensions/x86_64-darwin-13/2.0.0-static/mysql2-0.3.16/mysql2/mysql2.bundle, 9): Library not loaded: @@HOMEBREW_PREFIX@@/opt/openssl/lib/libssl.1.0.0.dylib (LoadError)
  Referenced from: /usr/lib/libmysqlclient.18.dylib
  Reason: image not found - /Users/adam/.rvm/gems/ruby-2.0.0-p481/extensions/x86_64-darwin-13/2.0.0-static/mysql2-0.3.16/mysql2/mysql2.bundle

MySQL installed through brew.

Unfortunately I am not sure how to fix this issue, so I appreciate every help.

Thank you

like image 617
user984621 Avatar asked Jun 20 '14 14:06

user984621


1 Answers

I was having the same issue on my rbenv setup after updating a few things in Homebrew. I simply recompiled Ruby and the problem went away. In this case it looks like you might want to recompile all the gems as well. According to this SO you can run rvm reinstall 2.0.0-p481 (recompiles ruby and removes all gems) and then re-bundle your project and you should be good to go.

I'm pretty sure what happened is a new version of openssl was installed as a dependency for something else I installed using Homebrew and that broke the linking between the compiled Ruby and the old version of libssl.

like image 106
tpett Avatar answered Sep 28 '22 12:09

tpett