我一直在修補這個問題好幾天,而且我仍然得到同樣的錯誤。對於初學者,我已經能夠用sqlite作爲數據庫啓動一個新的rails應用程序,但我們正在使用的應用程序使用Mysql。所以,當我去到應用程序目錄,鍵入「軌道服務器」它給了我如下:在mac os上用MySQL啓動rails服務器時出現錯誤
/Users/gojinjedi/.rvm/gems/[email protected]/gems/mysql2-0.2.7/lib/mysql2.rb:8:in `require': dlopen(/Users/gojinjedi/.rvm/gems/[email protected]/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/gojinjedi/.rvm/gems/[email protected]/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/gojinjedi/.rvm/gems/[email protected]/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
from /Users/gojinjedi/.rvm/gems/[email protected]/gems/mysql2-0.2.7/lib/mysql2.rb:8:in `<top (required)>'
from /Users/gojinjedi/.rvm/gems/[email protected]/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
from /Users/gojinjedi/.rvm/gems/[email protected]/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/gojinjedi/.rvm/gems/[email protected]/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `each'
from /Users/gojinjedi/.rvm/gems/[email protected]/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `block in require'
from /Users/gojinjedi/.rvm/gems/[email protected]/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `each'
from /Users/gojinjedi/.rvm/gems/[email protected]/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `require'
from /Users/gojinjedi/.rvm/gems/[email protected]/gems/bundler-1.0.15/lib/bundler.rb:120:in `require'
from /Users/gojinjedi/Sites/bluey/config/application.rb:7:in `<top (required)>'
from /Users/gojinjedi/.rvm/gems/[email protected]/gems/railties-3.0.7/lib/rails/commands.rb:28:in `require'
from /Users/gojinjedi/.rvm/gems/[email protected]/gems/railties-3.0.7/lib/rails/commands.rb:28:in `block in <top (required)>'
from /Users/gojinjedi/.rvm/gems/[email protected]/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap'
from /Users/gojinjedi/.rvm/gems/[email protected]/gems/railties-3.0.7/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
所以(我認爲),MySQL的開發頭沒有安裝,我到處一派如何安裝它們,並試圖大多數安裝命令行還沒有成功。命令的例子我已經試過:
gem install mysql2
sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include
我沒有捆綁安裝,捆綁更新和捆綁命令應用程序目錄......我跑出來的選項......你能幫助我嗎?
我在Mac OSX上10.7
其實你應該使用'ARCHFLAGS =「 - 拱x86_64的」 '如果你正在運行MacOS 10.7 – NARKOZ
不幸的是,在更改爲'「ARCHFLAGS =」 - arch x86_64「' –