Ruby-on-rails 降级宝石的正确方法是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6626514/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 01:33:22  来源:igfitidea点击:

What's the proper way to downgrade a gem?

ruby-on-railsruby-on-rails-3ruby-on-rails-3.1

提问by cailinanne

I recently installed the Rails3.1-Devise-Rspec-Cucumber Starter Appwith 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.

我最近使用下面列出的 Gemfile安装了Rails3.1-Devise-Rspec-Cucumber Starter App。这创建了一个 Gemfile.lock 文件(下面的相关片段),其中包含 factory_girl 2.0.0rc3。不幸的是,这个版本的 FactoryGirl 显然完全被破坏了

What's the proper way to force my bundle to use factory_girl 2.0.0.rc1 instead of 2.0.0rc3?

强制我的包使用 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"

Relevant snippet of Gemfile.lock

Gemfile.lock 的相关片段

factory_girl (2.0.0.rc3)
factory_girl_rails (1.1.rc1)
  factory_girl (~> 2.0.0.rc)
  railties (>= 3.0.0)

回答by chrispanda

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

in your gem file, and then run

在您的 gem 文件中,然后运行

bundle update factory_girl