1

I am just installing ruby / rails / gems ect. I installed rvm and I received many errors similar to this post, not sure if it is related. I believe I resolved the issues by installing ruby docs.

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

After installing everything I was able to create my project with the following command, which appeared successful

rails new simple_cms -d mysql

I then ran the following command and received the following errors,

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>'
4

1 回答 1

3

我遇到过类似的问题。添加类似于以下内容的符号链接对我有用:

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

请试一试。

于 2013-07-14T08:15:11.110 回答