2012-02-19 77 views
-1

好吧,我改变了我的宝石文件回滚宝石

黄瓜(1.0.6)

builder (>= 2.1.2) 
    diff-lcs (>= 1.1.2) 
    gherkin (~> 2.4.18) 
    json (>= 1.4.6) 
    term-ansicolor (>= 1.0.6) 
cucumber-rails (1.0.6) 
    capybara (>= 1.1.1) 
    cucumber (>= 1.0.6) 
    nokogiri (>= 1.5.0) 

但web_steps.rb文件没有出现?我是否需要在命令行中运行任何内容才能显示它?


的Gemfile:

黄瓜(1.1.7)

builder (>= 2.1.2) 
    diff-lcs (>= 1.1.2) 
    gherkin (~> 2.8.0) 
    json (>= 1.4.6) 
    term-ansicolor (>= 1.0.6) 
cucumber-rails (1.2.1) 
    capybara (>= 1.1.2) 
    cucumber (>= 1.1.3) 
    nokogiri (>= 1.5.0) 

感谢您的答案!但我现在得到错误?

你已申请: 黄瓜= 1.0.6

束目前已黄瓜锁定在1.1.7。 尝试运行bundle update cucumber

回答

0

您可以通过安装一个宝石的特定版本:

gem install <gem> -v=<version> 

例如

gem install cucumber -v=1.1.4 

然后你在你的Gemfile中指定,希望此特定版本:

gem 'cucumber', '1.1.4' 

这样,你的Rails应用程序应该使用你想要的版本。

关于你的Gemfile.lock问题。尝试使用

bundle update 

或删除Gemfile.lock的(它会当您尝试启动您的Rails应用程序可以自动重建)。

0

添加到您的Gemfile或chenge电流进入: gem 'cucumber', '1.1.1' 其中1.1.1是要使用黄瓜版本。接下来运行bundle

+0

你已申请: cucumber = 1.0.6 该捆绑包目前已将黄瓜锁定在1.1.7。 尝试运行'捆绑更新黄瓜' – 2012-02-19 21:57:20

+0

如何删除1.1。7并重新加载1.0.6? – 2012-02-19 21:57:45

+0

试试'bundle exec gem uninstall cucumber -v = 1.1.7' – Kuba 2012-02-19 22:06:52

0

将其更改为您的gem文件。因此,假如你想使用1.5版,你将有

gem 'cucumber', '1.5' 

接下来的事情将是从终端

运行bundle install安装宝石如果这是因为得到了web_steps.rb文件黄瓜删除,你可以添加以下到您的Gemfile

gem "cucumber-rails-training-wheels", :group => :test 

但是请务必阅读THIS