添加@javascript时的黄瓜错误,未定义的方法`each_pair'为19:Fixnum(NoMethodError)

时间:2012-02-23 08:01:37

标签: ruby-on-rails ruby ruby-on-rails-3 rubygems cucumber

我在功能/支持中有文件cabybara.rb(内容:Capybara.javascript_driver =:selenium) 我的测试脚本运行正常。但后来我添加了@javascript:

@javascript
Scenario: login to edit information account
....

我有这个错误:

undefined method each_pair' for 19:Fixnum (NoMethodError)
/home/wf04/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.10/lib/action_view/helpers/tag_helper.rb:120:intag_options'
/home/wf04/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.10/lib/action_view/helpers/tag_helper.rb:48:in tag'
/home/wf04/.rvm/gems/ruby-1.9.2-p290/gems/gherkin-2.3.6/lib/gherkin/lexer/i18n_lexer.rb:23:inscan'
/home/wf04/.rvm/gems/ruby-1.9.2-p290/gems/gherkin-2.3.6/lib/gherkin/lexer/i18n_lexer.rb:23:in scan'
/home/wf04/.rvm/gems/ruby-1.9.2-p290/gems/gherkin-2.3.6/lib/gherkin/parser/parser.rb:31:inparse'
/home/wf04/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/feature_file.rb:37:in parse'
/home/wf04/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/runtime/features_loader.rb:28:inblock in load'
/home/wf04/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/runtime/features_loader.rb:26:in each'
/home/wf04/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/runtime/features_loader.rb:26:inload'
/home/wf04/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/runtime/features_loader.rb:14:in features'
/home/wf04/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:132:infeatures'
/home/wf04/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:45:in run!'
/home/wf04/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/cli/main.rb:43:inexecute!'
/home/wf04/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/cli/main.rb:20:in execute'
/home/wf04/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/bin/cucumber:14:in'

我使用ruby 1.9.2和我的宝石版本:

* XMLCanonicalizer (1.0.1)
* abstract (1.0.0)
* actionmailer (3.0.10)
* actionpack (3.0.10)
* activemodel (3.0.10)
* activerecord (3.0.10)
* activeresource (3.0.10)
* activesupport (3.0.10)
* addressable (2.2.7)
* arel (2.0.10)
* awesome_print (1.0.2)
* aws-s3 (0.6.2)
* bcrypt-ruby (3.0.1)
* best_in_place (0.2.3)
* builder (2.1.2)
* bundler (1.0.21)
* capybara (1.1.2)
* carrierwave (0.5.8)
* celerity (0.9.2)
* childprocess (0.3.1)
* cocaine (0.2.1)
* coderay (1.0.5)
* cucumber (0.10.2)
* cucumber-rails (0.4.1)
* culerity (0.2.15)
* daemons (1.0.10)
* database_cleaner (0.6.7)
* devise (1.4.9)
* diff-lcs (1.1.3)
* erubis (2.6.6)
* excon (0.9.6)
* factory_girl (2.2.0)
* faker (1.0.1)
* faraday (0.7.6)
* ffi (1.0.11)
* fixture_builder (0.3.3)
* fog (1.1.2)
* foreman (0.39.0)
* formatador (0.2.1)
* formtastic (2.0.2)
* gem_plugin (0.2.3)
* geokit (1.6.5)
* geokit-rails3 (0.1.5)
* gherkin (2.3.6)
* haml (3.1.4)
* haml-rails (0.3.4)
* hashie (1.2.0)
* headless (0.2.2)
* honeypot-captcha (0.0.2)
* hpricot (0.8.6)
* i18n (0.5.0)
* jasmine (1.1.2)
* jasmine-core (1.1.0)
* jquery-rails (1.0.19)
* json (1.6.5)
* koala (1.3.0)
* launchy (2.0.5)
* linkedin (0.3.6)
* log4r (1.1.10)
* macaddr (1.5.0)
* mail (2.2.19)
* method_source (0.7.0)
* mime-types (1.17.2)
* mongrel (1.2.0.pre2)
* multi_json (1.0.4)
* multi_xml (0.4.1)
* multipart-post (1.1.5)
* net-ldap (0.2.2)
* net-scp (1.0.4)
* net-ssh (2.3.0)
* nokogiri (1.5.0)
* oa-basic (0.3.2)
* oa-core (0.3.2)
* oa-enterprise (0.3.2)
* oa-more (0.3.2)
* oa-oauth (0.3.2)
* oa-openid (0.3.2)
* oauth (0.4.5)
* oauth2 (0.5.2)
* omniauth (0.3.2)
* orm_adapter (0.0.6)
* paperclip (2.6.0)
* pg (0.13.2)
* pickle (0.4.10)
* polyglot (0.3.3)
* pry (0.9.8.2)
* pry-remote (0.1.1)
* pyu-ruby-sasl (0.0.3.3)
* rack (1.2.5)
* rack-mount (0.6.14)
* rack-openid (1.3.1)
* rack-test (0.5.7)
* rails (3.0.10)
* railties (3.0.10)
* rake (0.9.2.2)
* rdoc (3.12)
* recaptcha (0.3.4)
* remotipart (0.4.2)
* rest-client (1.6.7)
* right_aws (3.0.0)
* right_http_connection (1.3.0)
* rspec (2.8.0)
* rspec-core (2.8.0)
* rspec-expectations (2.8.0)
* rspec-mocks (2.8.0)
* rspec-rails (2.8.1)
* ruby-hmac (0.4.0)
* ruby-openid (2.1.8)
* ruby-openid-apps-discovery (1.2.0)
* ruby_parser (2.3.1)
* rubyntlm (0.1.1)
* rubyzip (0.9.6.1)
* selenium-webdriver (2.19.0)
* sexp_processor (3.0.10)
* slop (2.4.4)
* spork (0.9.0.rc9)
* sqlite3 (1.3.5)
* systemu (2.4.2)
* term-ansicolor (1.0.7)
* thor (0.14.6)
* treetop (1.4.10)
* tzinfo (0.3.31)
* uuid (2.3.5)
* warden (1.0.6)
* xml-simple (1.1.1)
* xpath (0.1.4)

请帮助我解决这个问题。非常感谢你

1 个答案:

答案 0 :(得分:0)

感谢aslak hellesoy提供了很好的解决方案 https://github.com/cucumber/cucumber-rails/issues/198