2011-04-24 113 views
2

我需要使用可尋址的2.2.4 gem,但我有2.2.5版本(因爲這裏討論的問題:https://github.com/sporkmonger/addressable/pull/33)。我想:如何在rails應用程序中強制使用gem版本?

source 'http://rubygems.org' 
source 'http://gems.github.com' 
gem "addresable", "2.2.4" 

bundle install 

,並得到Could not find gem 'adressable (= 2.2.4, runtime)' in any of the gem sources listed in your Gemfile.

如果我手動安裝/卸載寶石由

sudo gem install addressable -v 2.2.4 
sudo gem uninstall addressable -v 2.2.5 

我得到同樣的錯誤。

那麼,我該如何強制2.2.4版本爲我的應用程序?

回答

6
  1. 您在寶石行中拼寫錯誤「可尋址」。
  2. 您的包可能被鎖定在2.2.5 - 嘗試運行bundle update。這是違反直覺的,但它會用指定的版本重建你的Gemfile.lock。
  3. 您不再需要gems.github.com作爲源代碼 - 他們退出構建它並推薦rubygems.org。
+0

愚蠢的錯誤。謝謝。 – 2011-04-24 20:10:38

相關問題