黄瓜在更新捆绑软件后无法正常工作 [英] Cucumber failing to work after bundle update

查看:272
本文介绍了黄瓜在更新捆绑软件后无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行套件更新后,我突然发现我的黄瓜测试没有成功。



运行黄瓜功能给我:

  $ cucumber功能

使用默认配置文件...
未初始化的常量ActiveRecord(NameError)
/Library/Ruby/Gems/1.8/gems/rspec-expectations-2.3.0/lib/rspec/ expect / backward_compatibility.rb:6:in`const_missing'
/Library/Ruby/Gems/1.8/gems/default_value_for-1.0.1/lib/rails.rb:23
/ Library / Ruby / Site /1.8/rubygems/custom_require.rb:36:in` gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in`require'
/ Library / Ruby / Gems /1.8/gems/cucumber-rails-0.4.1/lib/cucumber/rails.rb:1
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in'gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in`require'
/Users/petenixey/Rails_apps/kind-advice/features/support/env.rb:7
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/rb_support/rb_language.rb:143:in`load'
/Library/Ruby/Gems/1.8 /gems/cucumber-0.10.2/bin/../lib/cucumber/rb_support/rb_language.rb:143:in`load_code_file'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2 /bin/../lib/cucumber/runtime/support_code.rb:176:in`load_file'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/ cucumber / runtime / support_code.rb:78:in`load_files!'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/runtime/support_code.rb :77:in`each'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/runtime/support_code.rb:77:in`load_files!'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/runtime.rb:137:in`load_step_definitions'
/ Library / Ruby / Gems /1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/runtime.rb:39:in`run!'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10。 2 / bin /../ lib / cucumber / cli / main.rb:43:in`execute!'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../ lib / cucumber / cli / main.rb:20:in`execute'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/cucumber:14
/ usr / bin / cucumber:19:in'load'
/ usr / bin / cucumber:19

我已尝试使用

重新安装Cucumber

  rails generate cucumber:install 
pre>

但是这似乎没有任何效果。



我的gemfile是:

  source:rubygems 
sourcehttp://rubygems.org

gemrails,〜> 3.0.3
gemsqlite3-ruby,:require => sqlite3
gemhoptoad_notifier
gempony
gemdefault_value_for
gemauthlogic
gem'jquery-rails','> 0.2.6'
gemrake

group:development,:test do
gemfaker
gemlaunchy
gemtest -unit
gemautotest
gemautotest-growl
gemautotest-rails-pure
gemautotest-fsevent
gemfactory_girl_rails
gemrspec-rails,〜> 2.3.0
gemruby-debug
gemcapybara,0.3.9
gem webrat
gem'cucumber-rails'
gem'database_cleaner'
gem'metric_fu'
end

我的gemfile.lock是:

  GEM 
remote: http://rubygems.org/
remote:http://rubygems.org/
规格:
Saikuro(1.1.0)
ZenTest(4.5.0)
abstract(1.0.0)
actionmailer(3.0.7)
actionpack(= 3.0.7)
mail(〜> 2.2.15)
actionpack 7)
activemodel(= 3.0.7)
activesupport(= 3.0.7)
builder(〜> 2.1.2)
erubis(〜> 2.6.6)
i18n(〜> 0.5.0)
rack(〜> 1.2.1)
rack-mount (〜> 0.6.14)
rack-test(〜> 0.5.7)
tzinfo(〜> 0.3.23)
activemodel(3.0.7)
activesupport(= 3.0.7)
builder(〜> 2.1.2)
i18n(〜> 0.5.0)
activerecord 3.0.7)
activesupport(= 3.0.7)
arel(〜> 2.0.2)
tzinfo(〜> 0.3.23)
activeresource )
activemodel(= 3.0.7)
activesupport(= 3.0.7)
activesupport(3.0.7)
arel(2.0.9)
arrayfields .4)
authlogic(2.1.6)
activesupport
autotest(4.4.6)
ZenTest(> = 4.4.1)
autotest-fsevent .5)
sys-uname
autotest-growl(0.2.9)
autotest-rails-pure(4.1.2)
builder(2.1.2)
capybara(0.3.9)
culerity(> = 0.2.4)
mime-types(> = 1.16)
nokogiri(> = 1.3.3)
(> = 1.0.0)
rack-test(> = 0.5.4)
selenium-webdriver(> = 0.0.3)
childprocess $ b ffi(〜> 1.0.6)
慢性(0.3.0)
churn(0.0.13)
慢性(> = 0.2.3)
hirb
json_pure
main
ruby​​_parser(〜> 2.0.4)
sexp_processor(〜> 3.0.3)
colored(1.2)
columnize(0.3.2)
配置(1.2.0)
cucumber(0.10.2)
builder(> = 2.1.2)
diff-lcs(> = 1.1.2)
gherkin > = 2.3.5)
json(> = 1.4.6)
term-ansicolor(> = 1.0.5)
cucumber-rails b cucumber(> = 0.10.1)
nokogiri(> = 1.4.4)
rack-test(> = 0.5.7)
culerity(0.2.15)
database_cleaner(0.6.6)
default_value_for(1.0.1)
diff-lcs(1.1.2)
erubis(2.6.6)
abstract(> = 1.0 .0)
factory_girl(1.3.3)
factory_girl_rails(1.0.1)
factory_girl(〜> 1.3)
railties(> = 3.0.0)
faker(0.9.5)
i18n(〜> 0.4)
fattr(2.2.0)
ffi(1.0.7)
rake(> = 0.8.7 )
flay(1.4.2)
ruby​​_parser(〜> 2.0)
sexp_processor(〜> 3.0)
flog(2.5.1)
ruby​​_parser(〜> 2.0)
sexp_processor(〜> 3.0)
gherkin (2.3.6)
json(> = 1.4.6)
haml(3.0.25)
hirb(0.4.3)
hoptoad_notifier $ b activesupport
builder
i18n(0.5.0)
jquery-rails(0.2.7)
rails(〜> 3.0)
thor(〜 0.14.4)
json(1.5.1)
json_pure(1.5.1)
launchy(0.4.0)
configuration(> = 0.0.5)
rake(> = 0.8.1)
linecache(0.43)
mail(2.2.17)
activesupport(> = 2.3.6)
i18n(> = 0.4.0)
mime-types(〜> 1.16)
treetop(〜> 1.4.8)
main(4.4.0)
arrayfields(> = 4.7 .4)
fattr(> = 2.1.0)
metric_fu(2.1.1)
Saikuro(> = 1.1.0)
activesupport(> = 2.0。 0)
慢性(〜> 0.3.0)
churn(> = 0.0.7)
flay(> = 1.2.1)
flog(> = 2.3.0)
rails_best_practices(> = 0.6.4)
rcov(> = 0.8.3.3)
reek(> = 1.2.6)
roodi ; = 2.1.0)
syntax
mime-types(1.16)
nokogiri(1.4.4)
polyglot(0.3.1)
pony b $ b mail(> 2.0)
rack(1.2.2)
rack-mount(0.6.14)
rack(> = 1.0.0)
rack- b $ b rack(> = 1.0)
rails(3.0.7)
actionmailer(= 3.0.7)
actionpack(= 3.0.7)
activerecord .7)
activeresource(= 3.0.7)
activesupport(= 3.0.7)
bundler(〜> 1.0)
railties(= 3.0.7)
rails_best_practices(0.7.5)
activesupport
colored(〜> 1.2)
erubis(〜> 2.6.6)
haml(〜> 3.0.18)
i18n
ruby​​-progressbar(〜> 0.0.9)
ruby​​_parser(〜> 2.0.4)
railties(3.0.7)
actionpack .b)
activesupport(= 3.0.7)
rake(> = 0.8.7)
thor(〜> 0.14.4)
rake
rcov(0.9.9)
reek(1.2.8)
ruby​​2ruby(〜> 1.2)
ruby​​_parser(〜> 2.0)
sexp_processor ; 3.0)
roodi(2.1.0)
ruby​​_parser
rspec(2.3.0)
rspec-core(〜> 2.3.0)
rspec-expectations(〜> 2.3.0)
rspec-mocks(〜> 2.3.0)
rspec-core(2.3.1)
rspec-expectations(2.3.0)
diff-lcs(〜> 1.1.2)
rspec-mocks(2.3.0)
rspec-rails b actionpack(〜> 3.0)
activesupport(〜> 3.0)
railties(〜> 3.0)
rspec(〜> 2.3.0)
ruby​​-debug (0.10.4)
columnize(> = 0.1)
ruby​​-debug-base(〜> 0.10.4.0)
ruby​​-debug- b linecache(> = 0.3)
ruby​​-progressbar(0.0.10)
ruby​​2ruby(1.2.5)
ruby​​_parser(〜> 2.0)
sexp_processor(〜> 3.0)
ruby​​_parser(2.0.6)
sexp_processor(〜> 3.0)
ruby​​zip(0.9.4)
selenium-webdriver(0.1.4)
childprocess (> = 0.1.7)
ffi(> = 1.0.7)
json_pure
ruby​​zip
sexp_processor(3.0.5)
sqlite3 )
sqlite3-ruby(1.3.3)
sqlite3(> = 1.3.3)
语法(1.0.0)
sys-uname(0.8.5)
term-ansicolor(1.0.5)
test-unit(2.3.0)
thor(0.14.6)
treetop(1.4.9)
polyglot = 0.3.1)
tzinfo(0.3.26)
webrat(0.7.3)
nokogiri(> = 1.2.0)
rack(> = 1.0)
rack-test(> = 0.5.3)

PLATFORMS
ruby​​

DEPENDENCIES
authlogic
autotest
autotest-fsevent
autotest-growl
autotest-rails-pure
capybara(= 0.3.9)
cucumber-rails
database_cleaner
default_value_for
factory_girl_rails
faker
hoptoad_notifier
jquery-rails(> = 0.2.6)
launchy
metric_fu
pony
rails > 3.0.3)
rake
rspec-rails(〜> 2.3.0)
ruby​​-debug
sqlite3-ruby
test-unit
webrat

我已经尝试删除我的黄瓜文件中的所有代码,看看他们是否影响但它没有区别。

解决方案

我终于在这里发现了问题。



由于问题出现在bundle更新后,我最终发现它可能不是我的代码导致的问题。



我试着做一个新的rails安装新的gems和确定足够我有同样的问题。



一个接一个,我经历了尝试删除宝石,看看它是否有所作为。最后,我卸载了default_value_for 1.0.1 gem,一切开始再次运行。



由于某种原因,default_value_for 1.0.1和最新的RSpec gem之间存在冲突。我报告这是一个bug在default_value_for github存储库,所以这可能不再是一个问题,但我还没有尝试重新安装它。


After running bundle update I have suddenly found that my cucumber tests are failing to get going.

Running cucumber features gives me:

$ cucumber features

Using the default profile...
uninitialized constant ActiveRecord (NameError)
/Library/Ruby/Gems/1.8/gems/rspec-expectations-2.3.0/lib/rspec/expectations/backward_compatibility.rb:6:in `const_missing'
/Library/Ruby/Gems/1.8/gems/default_value_for-1.0.1/lib/rails.rb:23
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
/Library/Ruby/Gems/1.8/gems/cucumber-rails-0.4.1/lib/cucumber/rails.rb:1
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
/Users/petenixey/Rails_apps/kind-advice/features/support/env.rb:7
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/rb_support/rb_language.rb:143:in `load'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/rb_support/rb_language.rb:143:in `load_code_file'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/runtime/support_code.rb:176:in `load_file'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/runtime/support_code.rb:78:in `load_files!'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/runtime/support_code.rb:77:in `each'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/runtime/support_code.rb:77:in `load_files!'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/runtime.rb:137:in `load_step_definitions'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/runtime.rb:39:in `run!'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/cli/main.rb:43:in `execute!'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/cli/main.rb:20:in `execute'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/cucumber:14
/usr/bin/cucumber:19:in `load'
/usr/bin/cucumber:19

I have tried "reinstalling" Cucumber using

rails generate cucumber:install

However this doesn't seem to have any effect.

My gemfile is:

source :rubygems
source "http://rubygems.org"

gem "rails", "~>3.0.3"
gem "sqlite3-ruby", :require => "sqlite3"
gem "hoptoad_notifier"
gem "pony"
gem "default_value_for"
gem "authlogic"
gem 'jquery-rails', '>= 0.2.6'
gem "rake"

group :development, :test do
  gem "faker"
  gem "launchy"
  gem "test-unit"
  gem "autotest"
  gem "autotest-growl"
  gem "autotest-rails-pure"
  gem "autotest-fsevent"
  gem "factory_girl_rails"
  gem "rspec-rails", "~> 2.3.0"
  gem "ruby-debug"
  gem "capybara", "0.3.9"
  gem "webrat"
  gem 'cucumber-rails'
  gem 'database_cleaner'
  gem 'metric_fu'
end

And my gemfile.lock is:

GEM
  remote: http://rubygems.org/
  remote: http://rubygems.org/
  specs:
    Saikuro (1.1.0)
    ZenTest (4.5.0)
    abstract (1.0.0)
    actionmailer (3.0.7)
      actionpack (= 3.0.7)
      mail (~> 2.2.15)
    actionpack (3.0.7)
      activemodel (= 3.0.7)
      activesupport (= 3.0.7)
      builder (~> 2.1.2)
      erubis (~> 2.6.6)
      i18n (~> 0.5.0)
      rack (~> 1.2.1)
      rack-mount (~> 0.6.14)
      rack-test (~> 0.5.7)
      tzinfo (~> 0.3.23)
    activemodel (3.0.7)
      activesupport (= 3.0.7)
      builder (~> 2.1.2)
      i18n (~> 0.5.0)
    activerecord (3.0.7)
      activemodel (= 3.0.7)
      activesupport (= 3.0.7)
      arel (~> 2.0.2)
      tzinfo (~> 0.3.23)
    activeresource (3.0.7)
      activemodel (= 3.0.7)
      activesupport (= 3.0.7)
    activesupport (3.0.7)
    arel (2.0.9)
    arrayfields (4.7.4)
    authlogic (2.1.6)
      activesupport
    autotest (4.4.6)
      ZenTest (>= 4.4.1)
    autotest-fsevent (0.2.5)
      sys-uname
    autotest-growl (0.2.9)
    autotest-rails-pure (4.1.2)
    builder (2.1.2)
    capybara (0.3.9)
      culerity (>= 0.2.4)
      mime-types (>= 1.16)
      nokogiri (>= 1.3.3)
      rack (>= 1.0.0)
      rack-test (>= 0.5.4)
      selenium-webdriver (>= 0.0.3)
    childprocess (0.1.8)
      ffi (~> 1.0.6)
    chronic (0.3.0)
    churn (0.0.13)
      chronic (>= 0.2.3)
      hirb
      json_pure
      main
      ruby_parser (~> 2.0.4)
      sexp_processor (~> 3.0.3)
    colored (1.2)
    columnize (0.3.2)
    configuration (1.2.0)
    cucumber (0.10.2)
      builder (>= 2.1.2)
      diff-lcs (>= 1.1.2)
      gherkin (>= 2.3.5)
      json (>= 1.4.6)
      term-ansicolor (>= 1.0.5)
    cucumber-rails (0.4.1)
      cucumber (>= 0.10.1)
      nokogiri (>= 1.4.4)
      rack-test (>= 0.5.7)
    culerity (0.2.15)
    database_cleaner (0.6.6)
    default_value_for (1.0.1)
    diff-lcs (1.1.2)
    erubis (2.6.6)
      abstract (>= 1.0.0)
    factory_girl (1.3.3)
    factory_girl_rails (1.0.1)
      factory_girl (~> 1.3)
      railties (>= 3.0.0)
    faker (0.9.5)
      i18n (~> 0.4)
    fattr (2.2.0)
    ffi (1.0.7)
      rake (>= 0.8.7)
    flay (1.4.2)
      ruby_parser (~> 2.0)
      sexp_processor (~> 3.0)
    flog (2.5.1)
      ruby_parser (~> 2.0)
      sexp_processor (~> 3.0)
    gherkin (2.3.6)
      json (>= 1.4.6)
    haml (3.0.25)
    hirb (0.4.3)
    hoptoad_notifier (2.4.9)
      activesupport
      builder
    i18n (0.5.0)
    jquery-rails (0.2.7)
      rails (~> 3.0)
      thor (~> 0.14.4)
    json (1.5.1)
    json_pure (1.5.1)
    launchy (0.4.0)
      configuration (>= 0.0.5)
      rake (>= 0.8.1)
    linecache (0.43)
    mail (2.2.17)
      activesupport (>= 2.3.6)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    main (4.4.0)
      arrayfields (>= 4.7.4)
      fattr (>= 2.1.0)
    metric_fu (2.1.1)
      Saikuro (>= 1.1.0)
      activesupport (>= 2.0.0)
      chronic (~> 0.3.0)
      churn (>= 0.0.7)
      flay (>= 1.2.1)
      flog (>= 2.3.0)
      rails_best_practices (>= 0.6.4)
      rcov (>= 0.8.3.3)
      reek (>= 1.2.6)
      roodi (>= 2.1.0)
      syntax
    mime-types (1.16)
    nokogiri (1.4.4)
    polyglot (0.3.1)
    pony (1.1)
      mail (> 2.0)
    rack (1.2.2)
    rack-mount (0.6.14)
      rack (>= 1.0.0)
    rack-test (0.5.7)
      rack (>= 1.0)
    rails (3.0.7)
      actionmailer (= 3.0.7)
      actionpack (= 3.0.7)
      activerecord (= 3.0.7)
      activeresource (= 3.0.7)
      activesupport (= 3.0.7)
      bundler (~> 1.0)
      railties (= 3.0.7)
    rails_best_practices (0.7.5)
      activesupport
      colored (~> 1.2)
      erubis (~> 2.6.6)
      haml (~> 3.0.18)
      i18n
      ruby-progressbar (~> 0.0.9)
      ruby_parser (~> 2.0.4)
    railties (3.0.7)
      actionpack (= 3.0.7)
      activesupport (= 3.0.7)
      rake (>= 0.8.7)
      thor (~> 0.14.4)
    rake (0.8.7)
    rcov (0.9.9)
    reek (1.2.8)
      ruby2ruby (~> 1.2)
      ruby_parser (~> 2.0)
      sexp_processor (~> 3.0)
    roodi (2.1.0)
      ruby_parser
    rspec (2.3.0)
      rspec-core (~> 2.3.0)
      rspec-expectations (~> 2.3.0)
      rspec-mocks (~> 2.3.0)
    rspec-core (2.3.1)
    rspec-expectations (2.3.0)
      diff-lcs (~> 1.1.2)
    rspec-mocks (2.3.0)
    rspec-rails (2.3.1)
      actionpack (~> 3.0)
      activesupport (~> 3.0)
      railties (~> 3.0)
      rspec (~> 2.3.0)
    ruby-debug (0.10.4)
      columnize (>= 0.1)
      ruby-debug-base (~> 0.10.4.0)
    ruby-debug-base (0.10.4)
      linecache (>= 0.3)
    ruby-progressbar (0.0.10)
    ruby2ruby (1.2.5)
      ruby_parser (~> 2.0)
      sexp_processor (~> 3.0)
    ruby_parser (2.0.6)
      sexp_processor (~> 3.0)
    rubyzip (0.9.4)
    selenium-webdriver (0.1.4)
      childprocess (>= 0.1.7)
      ffi (>= 1.0.7)
      json_pure
      rubyzip
    sexp_processor (3.0.5)
    sqlite3 (1.3.3)
    sqlite3-ruby (1.3.3)
      sqlite3 (>= 1.3.3)
    syntax (1.0.0)
    sys-uname (0.8.5)
    term-ansicolor (1.0.5)
    test-unit (2.3.0)
    thor (0.14.6)
    treetop (1.4.9)
      polyglot (>= 0.3.1)
    tzinfo (0.3.26)
    webrat (0.7.3)
      nokogiri (>= 1.2.0)
      rack (>= 1.0)
      rack-test (>= 0.5.3)

PLATFORMS
  ruby

DEPENDENCIES
  authlogic
  autotest
  autotest-fsevent
  autotest-growl
  autotest-rails-pure
  capybara (= 0.3.9)
  cucumber-rails
  database_cleaner
  default_value_for
  factory_girl_rails
  faker
  hoptoad_notifier
  jquery-rails (>= 0.2.6)
  launchy
  metric_fu
  pony
  rails (~> 3.0.3)
  rake
  rspec-rails (~> 2.3.0)
  ruby-debug
  sqlite3-ruby
  test-unit
  webrat

I've tried removing all of the code in my cucumber files to see if they're affecting things but it makes not difference. I'm at a loss as to how to fix this.

解决方案

I finally discovered the issue here.

Since the problem appeared after a bundle update I eventually figured out that it probably wasn't my code causing the issue.

I tried doing a fresh rails install with the new set of gems and sure enough I got the same problem.

One by one I went through and tried removing gems to see if it made a difference. Finally I uninstalled the default_value_for 1.0.1 gem and everything started to run again.

For some reason there was a conflict between default_value_for 1.0.1 and something in the latest RSpec gem. I reported this as a bug on the default_value_for github repository so this may no longer be an issue but I have not tried reinstalling it yet.

这篇关于黄瓜在更新捆绑软件后无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆