28

I recently installed the Rails3.1-Devise-Rspec-Cucumber Starter App with the Gemfile listed below. This created a Gemfile.lock file (relevant snippet below) that includes factory_girl 2.0.0rc3. Unfortunately, this version of FactoryGirl is apparently completely busted.

What's the proper way to force my bundle to use factory_girl 2.0.0.rc1 instead of 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"

Relevant snippet of Gemfile.lock

factory_girl (2.0.0.rc3)
factory_girl_rails (1.1.rc1)
  factory_girl (~> 2.0.0.rc)
  railties (>= 3.0.0)
cailinanne
  • 8,332
  • 5
  • 41
  • 49

1 Answers1

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

in your gem file, and then run

bundle update factory_girl
cailinanne
  • 8,332
  • 5
  • 41
  • 49
chrispanda
  • 3,204
  • 1
  • 21
  • 23
  • 1
    Did you do a 'bundle update factory_girl' after making the changes to your Gemfile? – Aaron Hinni Jul 08 '11 at 15:26
  • @chrispanda - Can you please modify your answer to include "and then run bundle update". It will then be the complete answer, and I can accept it. Thanks! – cailinanne Jul 08 '11 at 17:53
  • 7
    This may have some unwanted side effects. `bundle update` will update all gems, where as `budnle update factory_girl` will only update factory_girl and any relevant dependencies. – diedthreetimes Jul 08 '11 at 18:39
  • Is there a way to do this without editing the Gemfile? In my particular case, I'm trying to build somebody else's project, and "bundle install" is installing a buggy version of a gem. – jayhendren Apr 30 '19 at 21:05