Rails服务器错误?(rails 3)


/Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
  Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle
  Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle
    from /Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2.rb:8
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `require'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `require'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `each'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `require'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `each'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `require'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler.rb:120:in `require'
    from /Users/imran/simple_cms/config/application.rb:7
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/commands.rb:28:in `require'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/commands.rb:28
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/commands.rb:27
    from script/rails:6:in `require'
    from script/rails:6

有人知道我怎么能解决这个问题吗??提前感谢;-)

现在我明白了吗?

dyld:惰性符号绑定失败:符号未找到:引用自:/Library/Ruby/Gems/1.8/Gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle
期望在:flat命名空间

dyld: Symbol not found: _mysql_get_client_info/图书馆/Ruby/珠宝/1.8/珠宝/mysql2-0.3.2/lib/mysql2/mysql2.bundle
期望在:flat命名空间

跟踪/双极性晶体管陷阱

可能这篇文章与你的问题相似:库未加载:libmysqlclient.16。运行'rails server'

试试这个:

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

将其放入.profile(或.bashrc)中,并键入以下命令

my_term> source .profile

将"/usr/local/mysql/lib/"替换为mysql客户端的安装位置

从安装程序重新更新MySQL(例如,mysql-5.5.10-osx10.6-x86_64)。

mysqll2 gem:$ sudo gem install mysql2 -- --with-mysql-config=/usr/local/mysql-5.5.10-osx10.6-x86_64/bin/mysql_config

对于永久性修复,尝试通过命令创建软链接-

sudo ln -s /usr/local/mysql/lib/libmysqlclient.16.dylib /usr/lib/libmysqlclient.16.dylib
http://rorguide.blogspot.com/2011/07/getting-error-library-not-loaded.html

我也有这个问题,我在这里或其他问题中发现的任何建议都没有让我去任何地方,而是像root一样运行(与sudo rails s)。我猜当作为根运行时,它使用mysql库的正确路径,但是用install_name_tool更改它,正如这里的一个链接中所描述的那样,也不起作用。只要我没有发现问题,我需要用sudo启动我的rails应用程序。

相关内容

  • 没有找到相关文章

最新更新