Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the proper way to downgrade a gem?

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) 
like image 611
cailinanne Avatar asked Jul 08 '11 15:07

cailinanne


People also ask

How do I install specific versions of gems?

Use `gem install -v` You may already be familiar with gem install , but if you add the -v flag, you can specify the version of the gem to install. Using -v you can specify an exact version or use version comparators.


1 Answers

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

in your gem file, and then run

bundle update factory_girl 
like image 137
chrispanda Avatar answered Sep 20 '22 07:09

chrispanda