簡體   English   中英

黃瓜不起作用,但耙黃瓜可以

[英]Cucumber doesn't work but rake cucumber does

Jonathans-MacBook-Air-2:hw3-rottenpotatoes Jonathan$ cucumber
WARN: Unresolved specs during Gem::Specification.reset:
      tzinfo (~> 0.3.37)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
You have already activated activesupport 4.0.0, but your Gemfile requires activesupport 3.2.14. Using bundle exec may solve this. (Gem::LoadError)
/Users/Jonathan/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in `block in setup'
/Users/Jonathan/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.3.5/lib/bundler/runtime.rb:19:in `setup'
/Users/Jonathan/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
/Users/Jonathan/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.3.5/lib/bundler/setup.rb:7:in `'

但似乎我在此目錄中具有正確的rails版本。

Jonathans-MacBook-Air-2:hw3-rottenpotatoes Jonathan$ rails --version
Rails 3.2.14

我對紅寶石有點陌生,對為什么“耙黃瓜”有效但在終端中沒有“黃瓜”感到困惑。 我不知道如何設置ruby和gems,但我有一個直覺是在工作目錄中以某種方式告訴ruby使用rails 3.2.14,但是命令“ cucumber”僅檢測Activtesupport 4.0.0(相信與鐵軌綁在一起)

非常感謝!

cucumber是一個垃圾桶,而rake cucumber是執行庫的耙子任務。

嘗試bundle install -—binstubs ,然后嘗試cucumber

也許垃圾桶以某種方式過時了?

如果那不起作用,只需通過刪除project/bin目錄殺死binstub,然后重新運行bundle install -—binstubs

您已經安裝了多個版本的Rails,並且Cucumber不知道該使用哪個版本,因此它正在嘗試同時加載這兩個錯誤。

要使用Gemfile中指定的命令,請在所有命令之前指定bundle exec ,例如。 bundle exec cucumber

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM