尝试运行WEBrick和Rails时出现问题

时间:2011-05-10 00:52:33

标签: ruby-on-rails webrick

完成Ruby on Rails的Lynda培训,并通过rails s命令到达启动WEBrick服务器的程度。我与video / Users / myuser / Sites / simple_cms

位于同一目录中

我收到以下错误:

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

我按照说明@ Unable to start rails server
仍然得到错误。我也遵循了@ rails server fails to start with mysql2 using rvm & ruby 1.9.2-p0 on OSX 10.6.5的指示 任何帮助,将不胜感激。

1 个答案:

答案 0 :(得分:1)

好的,经过进一步的研究,我找到了自己的答案

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

这对我有用。只是因为其他人无法用原始解决方案解决这个问题 资料来源:http://samuel.kadolph.com/2011/04/mysql2-gem-and-mac-os-x-image-not-found/