我剛纔通過以下步驟加入黃瓜我的Rails應用程序:未初始化的常數小黃瓜::分析器::分析器(NameError)
添加
group :test do
gem 'cucumber'
end
我的Gemfile。
運行所bundle install
通過rails generate cucumber:install
當後面有沒有什麼特色,好像黃瓜按預期運行。
但是當我添加一個功能文件並運行bundle exec cucumber
我得到以下
未初始化的常數小黃瓜::分析器::分析器(NameError) /Users/purinkle/.rvm/gems/ruby-1.9 .3-p286 @ radfords/gems/cucumber-1.2.1/lib/cucumber/feature_file.rb:34:在
parse' /Users/purinkle/.rvm/gems/[email protected]/gems/cucumber-1.2.1/lib/cucumber/runtime/features_loader.rb:28:in
塊中加載' /Users/purinkle/.rvm/gems/[email protected] radfords/gems/cucumber-1.2.1/lib/cucumber/runtime/features_loader.rb:26:在each' /Users/purinkle/.rvm/gems/[email protected]/gems/cucumber-1.2.1/lib/cucumber/runtime/features_loader.rb:26:in
加載' /Users/purinkle/.rvm/gems/[email protected]/gems/cucumber -1.2.1/lib/cucumber/runtime/features_loader.rb:14:在features' /Users/purinkle/.rvm/gems/[email protected]/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:170:in
featu res' /Users/purinkle/.rvm/gems/[email protected]/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:46:inrun!' /Users/purinkle/.rvm/gems/[email protected]/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:43:in
execute!' /用戶/ purinkle/.rvm /寶石/紅寶石1.9.3-P286 @ radfords /斌/黃瓜:23:在load' /Users/purinkle/.rvm/gems/[email protected]/bin/cucumber:23:in
'
嘗試發生器與黃瓜護欄https://github.com/cucumber/cucumber-rails。在你的gem文件中加入'gem cucumber-rails' – AnkitG