私は Lynda Ruby on Rails 3 Essential Training ビデオに従っており、次を使用して MySQL データベースを使用するように事前構成された新しい Rails アプリケーションを作成しました。
rails new app -d mysql
次に、/app ディレクトリに移動し、Rails サーバーを起動しようとしました。
rails s
これが返されたものです:
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/mysql2-0.3.11/lib/mysql2.rb:9:in 'require': dlopen(/usr/local/rvm/gems/ruby-1.9.3-p392/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /usr/local/rvm/gems/ruby-1.9.3-p392/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
Reason: image not found - /usr/local/rvm/gems/ruby-1.9.3-p392/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/mysql2-0.3.11/lib/mysql2.rb:9:in '<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.2.4/lib/bundler/runtime.rb:68:in 'require'
from /usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.2.4/lib/bundler/runtime.rb:68:in 'block (2 levels) in require'
from /usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.2.4/lib/bundler/runtime.rb:66:in 'each'
from /usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.2.4/lib/bundler/runtime.rb:66:in 'block in require'
from /usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.2.4/lib/bundler/runtime.rb:55:in 'each'
from /usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.2.4/lib/bundler/runtime.rb:55:in 'require'
from /usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.2.4/lib/bundler.rb:128:in 'require'
from /Users/joemeissler/code/lynda/config/application.rb:7:in '<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:53:in 'require'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:53:in 'block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:50:in 'tap'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:50:in '<top (required)>'
from script/rails:6:in 'require'
from script/rails:6:in '<main>'
これが何であるか考えていますか?MySQLをインストールしました。mysql2 gem がインストールされ、Mountain Lion を使用しています。助けてくれてありがとう。