0
votes

Installed Rails 3.2.3 and MySQL 5.6 fine on my OSX 10.7.3

I created a new project called "simple_cms" and then, in the terminal, tried to launch webrick with "rails server" and got nothing.

Hideyoshis-MacBook-Pro:simple_CMS gregpfeffer$ rails s /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError) Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle from /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2.rb:9 from /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in require' from /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:inrequire' from /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in each' from /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:inrequire' from /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in each' from /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:inrequire' from /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler.rb:119:in require' from /Users/gregpfeffer/Sites/simple_cms/config/application.rb:7 from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:53:inrequire' from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:53 from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:50:in tap' from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:50 from script/rails:6:inrequire' from script/rails:6 Hideyoshis-MacBook-Pro:simple_CMS gregpfeffer$ sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib /Library/Ruby/Gems/1.8/gems/mysql2-0.2.4/lib/mysql2/mysql2.bundle install_name_tool: can't open file: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.4/lib/mysql2/mysql2.bundle (No such file or directory)

1
are you sure that mysql is running on your machine?natedavisolds

1 Answers

2
votes

try adding:

export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/:$DYLD_LIBRARY_PATH

To your .bash_profile

this assumes you accepted the default installation location for mysql