2011-07-08 47 views
19

我最近安裝了Rails3.1-Devise-Rspec-Cucumber Starter App,下面列出了Gemfile。這創建了一個包含factory_girl 2.0.0rc3的Gemfile.lock文件(相關代碼片段)。不幸的是,這個版本的FactoryGirl顯然是completely busted什麼是降級寶石的正確方法?

什麼是強制我的包使用factory_girl 2.0.0.rc1而不是2.0.0rc3的正確方法?

的Gemfile:

source 'http://rubygems.org' 
gem 'rails', '3.1.0.rc4' 
gem 'mysql2' 
gem 'sass-rails', "~> 3.1.0.rc" 
gem 'coffee-script' 
gem 'uglifier' 
gem 'jquery-rails' 
gem "therubyracer", ">= 0.8.2" 
gem "rspec-rails", ">= 2.6.1", :group => [:development, :test] 
gem "factory_girl_rails", ">= 1.1.beta1", :group => :test 
gem "cucumber-rails", ">= 1.0.0", :group => :test 
gem "capybara", ">= 1.0.0", :group => :test 
gem "database_cleaner", ">= 0.6.7", :group => :test 
gem "launchy", ">= 0.4.0", :group => :test 
gem "devise", ">= 1.3.4" 

Gemfile.lock的的有關片段

factory_girl (2.0.0.rc3) 
factory_girl_rails (1.1.rc1) 
    factory_girl (~> 2.0.0.rc) 
    railties (>= 3.0.0) 
在寶石文件
+0

你試圖運行「捆綁更新「你想使用的factory_girl版本? – MunkiPhD

+0

啊,是的!不直觀(更新降級),但同時也非常明顯。謝謝! – cailinanne

回答

28
gem "factory_girl", "2.0.0.rc1", :group => :test 

,然後運行

bundle update factory_girl 
+0

好吧,我確實覺得這看起來太簡單了.... – chrispanda

+1

在對Gemfile進行更改後,你做了一個'bundle update factory_girl'嗎? –

+0

@chrispanda - 您可以修改您的答案以包含「然後運行軟件包更新」。這將是完整的答案,我可以接受它。謝謝! – cailinanne