每当我运行黄瓜功能时,我都会收到以下错误。
但是,该脚本工作正常,但每次执行功能文件时都会出现此警告消息。这里有什么问题吗?
C:\Automation\PickLists\Activities\2.RemoveActivity>cucumber
WARNING: cannot load such file -- 2.1/gherkin_lexer_en
Couldn't load 2.1/gherkin_lexer_en
The $LOAD_PATH was:
lib
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/cucumber-1.3.18/bin/../lib
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/builder-3.2.2/lib
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/diff-lcs-1.2.5/lib
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/multi_json-1.10.1/lib
C:/Ruby21-x64/lib/ruby/gems/2.1.0/extensions/x64-mingw32/2.1.0/gherkin-2.12.2
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2/lib
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/multi_test-0.1.1/lib
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/cucumber-1.3.18/lib
C:/Ruby21-x64/lib/ruby/gems/2.1.0/extensions/x64-mingw32/2.1.0/json-1.8.2
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/json-1.8.2/lib
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rubyzip-1.1.6/lib
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.9.6-x64-mingw32/lib
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/childprocess-0.5.5/lib
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/websocket-1.2.1/lib
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/watir-webdriver-0.6.11/lib
C:/Ruby21-x64/lib/ruby/site_ruby/2.1.0
C:/Ruby21-x64/lib/ruby/site_ruby/2.1.0/x64-msvcrt
C:/Ruby21-x64/lib/ruby/site_ruby
C:/Ruby21-x64/lib/ruby/vendor_ruby/2.1.0
C:/Ruby21-x64/lib/ruby/vendor_ruby/2.1.0/x64-msvcrt
C:/Ruby21-x64/lib/ruby/vendor_ruby
C:/Ruby21-x64/lib/ruby/2.1.0
C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32
C:/Automation/PickLists/Activities/2.RemoveActivity/lib. Reverting to Ruby lexer
这个解决方法对我有用。后bundle install
,去掉小黄瓜宝石:
gem uninstall gherkin --force
重新安装 gem(可能需要一段时间):
gem install gherkin --platform ruby -v 2.12.2
转到 ruby 安装目录中的 gem 文件夹。像这样的事情:
{ruby_dir}\lib\ruby\gems\2.1.0\gems\gherkin-2.12.2\lib\gherkin
并更换lib/gherkin/c_lexer.rb
第 7 行:
prefix = ''
此解决方法在中指定https://github.com/cucumber/gherkin/issues/273 https://github.com/cucumber/gherkin/issues/273mscharley 于 2014 年 1 月 18 日发表评论。
在 Windows 操作系统上安装每个捆绑包后,我必须遵循这些步骤。在 Windows 7 和 Windows 10 上进行了测试。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)