简体   繁体   English

rails s error os x 10.8.4 rvm

[英]rails s error os x 10.8.4 rvm

I am just installing ruby / rails / gems ect. 我只是安装ruby / rails / gems等。 I installed rvm and I received many errors similar to this post, not sure if it is related. 我安装了rvm,我收到了很多类似于这篇文章的错误,不确定它是否相关。 I believe I resolved the issues by installing ruby docs. 我相信我通过安装ruby docs解决了这些问题。

https://gist.github.com/klynton/5864062#file-rails-4-0-0-install-L1 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>'

I had experienced a similar issue. 我遇到了类似的问题。 Adding a symlink similar to the following worked for me: 添加类似以下的符号链接为我工作:

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

Please give this a try. 请试一试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM