2011-04-21 97 views
0

Final編輯:我玩了幾個不同的文件,出現了一些錯誤,然後從頭開始重新安裝rvm和其他一切,發現了一些修復程序並對它們進行了編輯,最後一切正常。謝謝大家的幫助MySQL和Rails服務器問題

編輯:我注意到,它說,圖書館沒有裝載:/usr/local/mysql-5.5.10-osx10.6-x86_64/lib/libmysqlclient.18.dylib(LoadError)

但我有MySQL 5.5.11,我該如何解決?

我簡直已經尋找了近3個小時,但沒有發現任何工作時,我要麼嘗試啓動服務器或生成一個模型發生

同樣的錯誤

我有捆綁和mysql2寶石。

助洗劑(2.1.2) 捆綁(1.0.12) erubis(2.6.6) I18N(0.5.0) 郵件(2.2.17) MIME類型(1.16) mysql2(0.2。 7)

我得到以下輸出:

hrs772:demo kishinmanglani$ rails s 
/Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2.rb:8:in `require': dlopen(/Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle, 9): Library not loaded: /usr/local/mysql-5.5.10-osx10.6-x86_64/lib/libmysqlclient.18.dylib (LoadError) 
    Referenced from: /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle 
    Reason: image not found - /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle 
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2.rb:8:in `<top (required)>' 
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `require' 
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `block (2 levels) in require' 
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `each' 
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `block in require' 
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `each' 
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `require' 
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler.rb:120:in `require' 
    from /Users/kishinmanglani/rails_projects/demo/config/application.rb:7:in `<top (required)>' 
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:28:in `require' 
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:28:in `block in <top (required)>' 
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap' 
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/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>' 
+0

以野生刺here..have您嘗試使用另一個MySQL寶石?我所知道的是'mysql',''mysql2'和'mysql-ruby'。 – pthesis 2011-04-21 05:06:37

+0

我還沒有,但我寧願用mysql2 gem解決問題,而不是隻切換到mysql或mysql-ruby gems – mergesort 2011-04-21 05:23:19

回答

1

每當你加載錯誤,你應該確保你安裝了所有的依賴和到位。

  1. 確保您的Gemfile中有gem mysql2
  2. 如果您還沒有gem install bundler,請安裝捆綁軟件。
  3. 運行bundle(與bundle install相同)。

然後再次嘗試運行服務器。

+0

編輯我的帖子,我應該已經明確表示我有 – mergesort 2011-04-21 05:18:25

0

mysql2與導軌3.0.3是給一些錯誤,以便嘗試更新軌道版本3.0.6

它工作正常,所以儘量

+1

我實際上使用rails 3.0.7 – mergesort 2011-04-21 05:27:56

+0

軌道3.0.7不穩定現在它也給我錯誤的Jruby所以嘗試使用軌道3.0.6其更穩定的工作真的很好 – jayesh 2011-04-21 08:52:16

+0

現在我得到的錯誤無法找到rails-3.0.7在任何安裝3.0.6後的源代碼和卸載3.0.7 – mergesort 2011-04-21 15:41:51