[英]Go to cucumber step definition in Spacemacs throws an exception: “Can not load such file — gherkin”
I have a ruby on rails project with feature specs written on cucumber and I am trying to set-up feature mode in my Spacemacs(Emacs) in order to be able to go to a cucumber step definition. 我有一个ruby on rails项目,其中的功能说明写在黄瓜上,我试图在我的Spacemacs(Emacs)中设置功能模式,以便能够进行黄瓜步骤定义。 In the project, we are using gherkin version 4.0, and I believe, the reason for my error could be that I need to instal another version of gherkin, that the Spacemacs feature mode could work properly.
在该项目中,我们使用的是gherkin 4.0版,我相信,导致我的错误的原因可能是我需要安装另一个版本的gherkin,Spacemacs功能模式才能正常工作。 Nevertheless, at the same time, I need to have 4.0 version also installed for the project.
不过,与此同时,我还需要为该项目安装4.0版本。
I have tried installing gherkin version 4.0 with bundler from Gemfile locally: bundle install
and installing gherkin version 2.11.8 globally with gem install command: gem install gherkin -v 2.11.8
我尝试从本地Gemfile使用bundler
bundle install
gherkin版本4.0: bundle install
并使用gem install命令在全局安装gherkin版本2.11.8: gem install gherkin -v 2.11.8
Unfortunately, didn't help :( 不幸的是,没有帮助:(
Stack: ruby, erb, rails, cucumber, rspec, spacemacs (emacs), 堆栈:红宝石,erb,rails,黄瓜,rspec,spacemacs(emacs),
I was suffering from the same issue and found that the lower bound on the gem version for Gherkin in feature-mode/support/find_step.rb
is not sufficient. 我遇到了同样的问题,发现在
feature-mode/support/find_step.rb
的gem版本中, feature-mode/support/find_step.rb
不够。 Newer versions of Gherkin seem to cause an exception to be thrown. 较新版本的Gherkin似乎会引发异常。 My hacky workaround is the following:
我的解决方法如下:
first install this version of gherkin 首先安装此版本的小黄瓜
gem install gherkin --version 2.11.8
then in spacemacs do the following command:
spc h d p feature-mode
open the package and navigate to support/find_step.rb
change
gem 'gherkin', '>= 2.11.8'
to
gem 'gherkin', '2.11.8'
save the file, and the feature-goto-step-definition function should work again
The package might no longer be maintained and needs a home. 该包裹可能不再维护,需要回家。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.