0

我正在关注 Lynda Ruby on Rails 3 Essential Training 视频,刚刚创建了一个新的 Rails 应用程序,预配置为使用 MySQL 数据库:

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 上。谢谢您的帮助。

4

0 回答 0