我很长一段时间都遇到了rails问题,我尝试了很多我在这里发现的类似问题的答案,但是虽然其中一些对一些错误有效,但我一直卡住并且无法解决这个问题,我尝试了大多数解决方案对于我发现并最终决定问自己的类似问题,此错误仅在启动此特定项目的服务器时发生,而服务器为新的空 rails 项目正常启动:
$ rails server
/Users/celorisoli/.rvm/gems/ruby-1.9.2-p320/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `require': dlopen(/Users/celorisoli/.rvm/gems/ruby-1.9.2-p320/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: /usr/local/mysql/lib/libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/celorisoli/.rvm/gems/ruby-1.9.2-p320/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
Reason: no suitable image found. Did find:
/usr/local/mysql/lib/libmysqlclient.18.dylib: mach-o, but wrong architecture
/usr/local/mysql/lib/libmysqlclient.18.dylib: mach-o, but wrong architecture
/usr/lib/libmysqlclient.18.dylib: mach-o, but wrong architecture - /Users/celorisoli/.rvm/gems/ruby-1.9.2-p320/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
from /Users/celorisoli/.rvm/gems/ruby-1.9.2-p320/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `<top (required)>'
from /Users/celorisoli/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require'
from /Users/celorisoli/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/celorisoli/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `each'
from /Users/celorisoli/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `block in require'
from /Users/celorisoli/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `each'
from /Users/celorisoli/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `require'
from /Users/celorisoli/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler.rb:128:in `require'
from /Users/celorisoli/logbook/config/application.rb:7:in `<top (required)>'
from /Users/celorisoli/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:53:in `require'
from /Users/celorisoli/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:53:in `block in <top (required)>'
from /Users/celorisoli/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:50:in `tap'
from /Users/celorisoli/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
大多数答案有助于解决“找不到图像”的问题,但是这里的错误如下:
Reason: no suitable image found. Did find: