rails server command failing
I'm on OS X Snow Leopard, I开发者_如何学Go 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:inrequire' 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:ineach' 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:ineach' 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:inrequire' 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:intap' from /usr/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:27 from script/rails:6:in
require' 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
This looks similar (if not identical) to this problem. There are a number of possible solutions on that question.
精彩评论