1

我是一个新手,正在尝试遵循 Rails 教程并已成功运行来自http://railsinstaller.org/的安装例程

我也安装了mysql

我用过命令> rails new simple_cms -d mysql

这似乎运行成功

当我运行 Rails 服务器时

这是下面的输出 - 似乎没有在端口 3000 上启动 WEBrick

非常感谢

================

/usr/local/rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.3.11/lib/mysql2.rb:9:in '来自 /usr/local/rvm/gems/ruby-1.9.3 -p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in block (2 levels) in require' from /usr/local/rvm/gems/ruby-1.9.3-p194@ global/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in block in require' 来自 /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1 .5/lib/bundler/runtime.rb:55:in 需要'来自 /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler.rb: 119:in '来自 /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.7/lib/rails/commands.rb:53:in 块来自 /usr/local/ rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.7/lib/rails/commands.rb:50:in require': dlopen(/usr/local/rvm/gems/ruby-1.9.3-p194/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-p194/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle Reason: image not found - /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.3.11/lib/mysql2.rb:9:in
require' from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in each' from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in each' from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in require' from /Users/amelrose/Sites/simple_cms/config/application.rb:7:inrequire' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.7/lib/rails/commands.rb:53:in tap' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.7/lib/rails/commands.rb:50:in '来自脚本/rails:6:in require' from script/rails:6:in'

4

1 回答 1

1

我有同样的问题。因为在 Mac OS X 上,mysql 通常/usr/local/mysql安装libmysqlclient/usr/lib.

在终端中运行它:

sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
于 2012-08-07T16:57:55.837 回答