无法加载此类文件 -- 2.2/gherkin_lexer_en,如何解决?

cannot load such file -- 2.2/gherkin_lexer_en, how to fix?

我需要一点帮助。我该如何解决这个问题?

当我调用 cucumber 时出现以下错误:

  *** WARNING: You must use ANSICON 1.31 or higher (https://github.com/adoxa/ansic
on/) to get coloured output on Windows
WARNING: cannot load such file -- 2.2/gherkin_lexer_en
Couldn't load 2.2/gherkin_lexer_en
The $LOAD_PATH was:
lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-1.3.19/bin/../lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/builder-3.2.2/lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/diff-lcs-1.2.5/lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/multi_json-1.11.0/lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/gherkin-2.12.2-x86-mingw32/lib
[...]

系统:

我得到答案: https://github.com/cucumber/cucumber/issues/830#issuecomment-90837546

I'm afraid Cucumber on Windows/Ruby requires ruby 2.0.0 (x86). The reason is that the gherkin gem doesn't yet ship with compiled binaries for more recent versions or Ruby, and not for x64.

We're working on a Gherkin3 which will address this issue. See this post for background. I cannot give you an ETA, but it's at least a few months away.

这个问题看起来像 this issue。也许您可以通过关注其中的评论来解决。 (y)

sanjaykumar5115 commented, my probelm have been solved after uninstalling gherkin and installing gherkin-2.12.1-x86-mingw32

  • 我从 http://rubyinstaller.org/downloads/
  • 下载 Ruby 2.0 x86
  • 安装exe
  • cmd 中的命令:gem install calabash-android
  • ERROR: Error installing calabash-android: The 'json' native gem requires installed build tools.
  • http://rubyinstaller.org/downloads/ 下载 DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe
  • 将 DevKit 解压到路径 C:\Ruby200\DevKit
  • 运行 cd C:\Ruby200\DevKit
  • 运行 ruby dk.rb 初始化
  • 运行rubydk.rb评论
  • 运行 ruby dk.rb 安装
  • 然后再次使用命令gem install calabash-android

我只是通过删除 Gherkin 并通过 bundle install

重新安装来解决
gem uninstall gherkin
>> select all
bundle install