2011-05-23 58 views
0

我對RoR非常非常非常新,我在Windows 7環境中執行此操作。 是的,我知道,「爲什麼不ubuntu?」我們嘗試過......表現很慢。紅寶石依賴項錯誤

無論如何,我的機器上運行着RoR,並且我創建了一個恰當地命名爲「testApp」的測試應用程序。

我在瀏覽器中運行它..voila!沒什麼大不了的。我有我的基本網站。

現在,當我試着和檢出的網站我的桌面上運行它,我得到這個

C:\devApp>ruby script/server 
=> Booting WEBrick 
=> Rails 2.3.5 application starting on http://0.0.0.0:3000 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:in  `requirement': undefined local variable or method `version_requirements' for 
#<Rails::GemDependency:0x35eae38> (NameError) 
    from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems.rb:254:in `activate' 
    from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems.rb:1204:in `gem' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails/gem_dependency.rb:73:in `add_load_paths' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:301:in `block in add_gem_load_paths' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:301:in `each' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:301:in `add_gem_load_paths' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:132:in `process' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:113:in `run' 
    from C:/srw/config/environment.rb:12:in `<top (required)>' 
    from <internal:lib/rubygems/custom_require>:29:in `require' 
    from <internal:lib/rubygems/custom_require>:29:in `require' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/commands/server.rb:84:in `<top (required)>' 
    from <internal:lib/rubygems/custom_require>:29:in `require' 
    from <internal:lib/rubygems/custom_require>:29:in `require' 
    from script/server:3:in `<main>' 

而且沒有服務器已啓動。我已經經歷了所有的寶石,確保根據我的首席開發人員告訴我,我擁有正確的版本。我們現在都在撓頭。

有人可以幫我找出我失蹤的依賴嗎?

謝謝!

回答

-1

好像你試圖運行一個沒有所有必需的gem的應用程序,我會嘗試安裝在「Gemfile」(應用程序的根目錄)中提到的所有gem,然後再次運行該應用程序。作爲一個Windows用戶,我真的會建議你嘗試在Ubuntu上做你的rails學習和開發(就像我一樣)。安裝,維護,測試應用程序並獲得幫助要容易得多。

0

我認爲這是因爲你的RubyGems版本過時了。嘗試運行gem update --system將其更新至最新版本

+0

試過這個無濟於事......但現在我有更多注意:關於寶石的警報被棄用。 – Loony2nz 2011-05-23 21:33:13

0

試試這個。

只是更新你的捆綁軟件,可能是任何一個老的寶石與最新的一個衝突,這種類型的問題出現。

'gem install bundler' 

然後'bundler install'

如果發現再次出錯,然後刪除GEM.lock文件,然後運行bundler instal湖它可能會解決這個問題。

全部最好!!!