rails s error os x 10.8.4 rvm

时间:2013-07-14 08:06:29

标签: ruby-on-rails rvm osx-mountain-lion

我只是安装ruby / rails / gems等。我安装了rvm,我收到了很多类似于这篇文章的错误,不确定它是否相关。我相信我通过安装ruby docs解决了这些问题。

https://gist.github.com/klynton/5864062#file-rails-4-0-0-install-L1

安装完所有内容后,我可以使用以下命令创建项目,该命令似乎成功

rails new simple_cms -d mysql

然后我运行以下命令并收到以下错误,

jg$ rails s
/Users/jgr/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `require': dlopen(/Users/jgr/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
  Referenced from: /Users/jg/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
  Reason: image not found - /Users/jg/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
    from /Users/jg/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `<top (required)>'
    from /Users/jg/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
    from /Users/jg/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from /Users/jg/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
    from /Users/jg/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
    from /Users/jgr/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
    from /Users/jg/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
    from /Users/jg/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
    from /Users/jg/Documents/Sites/simple_cms/config/application.rb:7:in `<top (required)>'
    from /Users/jg/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
    from /Users/jg/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>'
    from /Users/jg/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
    from /Users/jg/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

1 个答案:

答案 0 :(得分:3)

我遇到了类似的问题。添加类似于以下内容的符号链接为我工作:

sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib

请试一试。