0

I'm on OS X Snow Leopard, I have installed MySQL using the OS X packages found on the MySQL download website, Ruby 1.8.7 from source code (which ruby yields usr/local/bin/ruby only) and RubyGem 1.7.1 (upgraded from 1.3.1 using gem update --system) from source code too (after updating gem I re-ran gem update). The start/stop MySQL server prefpane is installed, too.

After this I have installed the rdoc, mysql and mysql2 gems using gem install rdoc, gem install mysql and gem install mysql2, in this order.

After creating a sample project, I modified the database.yml so that mysql is the db used instead of sqlite3.

Then, I cd into the project folder and run rails server with the following error:

sample$ rails server /usr/local/lib/ruby/gems/1.8/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle: dlopen(/usr/local/lib/ruby/gems/1.8/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /usr/local/lib/ruby/gems/1.8/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle Reason: image not found - /usr/local/lib/ruby/gems/1.8/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle from /usr/local/lib/ruby/gems/1.8/gems/mysql2-0.2.7/lib/mysql2.rb:8 from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/runtime.rb:68:in require' from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/runtime.rb:68:in require' from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/runtime.rb:66:in each' from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/runtime.rb:66:in require' from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/runtime.rb:55:in each' from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/runtime.rb:55:in require' from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler.rb:120:in require' from /Users/riccardo/Workspace/restaurant/config/application.rb:7 from /usr/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:28:in require' from /usr/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:28 from /usr/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:27:in tap' from /usr/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:27 from script/rails:6:inrequire' from script/rails:6

What's wrong with my configuration? I read that there are files to rename (?) but I did not understand how. Thanks very much in advance to everybody Riccardo

Sicco
  • 6,167
  • 5
  • 45
  • 61
  • http://www.blog.bridgeutopiaweb.com/post/how-to-fix-mysql-load-issues-on-mac-os-x/ – fl00r Apr 05 '11 at 13:09
  • http://stackoverflow.com/questions/4546698/library-not-loaded-libmysqlclient-16-dylib-error-when-trying-to-run-rails-serve – fl00r Apr 05 '11 at 13:10

1 Answers1

0

This looks similar (if not identical) to this problem. There are a number of possible solutions on that question.

Community
  • 1
  • 1
Robin Fisher
  • 1,454
  • 1
  • 13
  • 23