【问题标题】:Rails Server Not Starting In OSX 10.73Rails 服务器未在 OSX 10.73 中启动
【发布时间】:2012-05-15 14:39:38
【问题描述】:

在我的 OSX 10.7.3 上安装了 Rails 3.2.3 和 MySQL 5.6

我创建了一个名为“simple_cms”的新项目,然后在终端中尝试使用“rails server”启动 webrick,但一无所获。

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.捆绑包,9):未加载库:libmysqlclient.18.dylib(LoadError) 引用自:/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle 原因:找不到图像 - /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle 来自 /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2.rb:9 来自 /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' 来自 /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' 来自 /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' 来自 /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' 来自 /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:53 来自 /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' 来自脚本/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:无法打开文件:/Library/Ruby/Gems/1.8/gems/mysql2-0.2.4/lib/mysql2/mysql2.bundle(没有这样的文件或目录)

【问题讨论】:

  • 你确定你的机器上正在运行mysql吗?

标签: mysql ruby-on-rails webrick


【解决方案1】:

尝试添加:

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

到你的 .bash_profile

这假设您接受了 mysql 的默认安装位置

【讨论】:

    猜你喜欢
    • 2023-04-05
    • 1970-01-01
    • 2015-04-15
    • 2013-10-15
    • 1970-01-01
    • 1970-01-01
    • 2017-01-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多