1

Like Meltemi posted on this post: Passenger error "library not loaded" i get the same error. but the answer posted does not help!

dlopen(/Users/andi/.rvm/gems/ruby-1.9.2-p136/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle, 9):
Library not loaded: libmysqlclient.16.dylib
Referenced from: /Users/andi/.rvm/gems/ruby-1.9.2-p136/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/andi/.rvm/gems/ruby-1.9.2-p136/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle

Im operating with RVM 1.2.6, Rails 3.0.3, Ruby 1.9.2. The server worked fine, till i switched my repository from svn to git. It seems very strange to me that this change effected my installation.

$bundle list
Gems included by the bundle:
...
  * mysql2 (0.2.7)
...


$ /usr/local/mysql-5.5.8-osx10.6-x86_64/bin/mysql --version
/usr/local/mysql-5.5.8-osx10.6-x86_64/bin/mysql  Ver 14.14 Distrib 5.5.8, for osx10.6 (i386) using readline 5.1

thx for response!

EDIT: solution:

according to rails server fails to start with mysql2 using rvm & ruby 1.9.2-p0 on OSX 10.6.5 and http://freddyandersen.wordpress.com/2010/10/03/mysql-5-5-snow-leopard-and-rails/

this command solves my problem: sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib ~/.rvm/gems/ruby-1.9.2-p136/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle

Community
  • 1
  • 1
andi
  • 311
  • 1
  • 16
  • Looks like you have MySQL client v14 installed, but ruby is looking for v16? – Thilo May 02 '11 at 09:22
  • Hmm.. I see. and where can I change this config? Or would it be better to upgrade mysql? – andi May 02 '11 at 09:46
  • Not sure, and I'm not 100% that that's actually the problem. Also take a look at http://stackoverflow.com/questions/4512362/rails-server-fails-to-start-with-mysql2-using-rvm-ruby-1-9-2-p0-on-osx-10-6-5 – Thilo May 02 '11 at 10:03
  • tried this: sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib ~/.rvm/gems/ruby-1.9.2-p136/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle according to: http://freddyandersen.wordpress.com/2010/10/03/mysql-5-5-snow-leopard-and-rails/ – andi May 02 '11 at 10:07
  • thx Thilo, we found the same hint ;) but it didn't resolve my problem – andi May 02 '11 at 10:09
  • *argh... taking the right mysql gem solves the problem: sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib ~/.rvm/gems/ruby-1.9.2-p136/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle thx to you thilo! – andi May 02 '11 at 10:12
  • As far as Stack Overflow etiquette goes, you should post your solution as an answer to the question and accept it. It will give you rep and will make the community happy. – Mike Farmer May 02 '11 at 21:33

1 Answers1

2

solution:

according to rails server fails to start with mysql2 using rvm & ruby 1.9.2-p0 on OSX 10.6.5 and http://freddyandersen.wordpress.com/2010/10/03/mysql-5-5-snow-leopard-and-rails/

this command solves my problem: sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib ~/.rvm/gems/ruby-1.9.2-p136/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle

andi
  • 311
  • 1
  • 16