cucumber-attic / gherkin2

A fast Gherkin parser in Ragel (The parser behind Cucumber)
MIT License
382 stars 221 forks source link

cannot load such file -- 2.1/gherkin_lexer_en #320

Closed anilreddy closed 8 years ago

anilreddy commented 9 years ago

Hi,

Today I have upgraded ruby ver. to 2.1.3 in windows 8 OS and executed a selenium script with cucumber and I came up with this issue. Let me know if you need more info.

D:\Selenium\Selenium Ruby\table_test>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.1/gherkin_lexer_en
Couldn't load 2.1/gherkin_lexer_en
The $LOAD_PATH was:
D:/Selenium/Selenium Ruby/table_test/features/support/../../lib
lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.17/bin/../lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/builder-3.2.2/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/diff-lcs-1.2.5/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/multi_json-1.10.1/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/multi_test-0.1.1/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.17/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/rspec-support-3.1.0/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.4/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/rspec-expectations-3.1.1/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/rspec-mocks-3.1.1/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/rspec-3.1.0/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/rubyzip-1.1.6/lib
C:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/ffi-1.9.3
C:/Ruby21/lib/ruby/gems/2.1.0/gems/ffi-1.9.3/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/ffi-1.9.3/ext/ffi_c
C:/Ruby21/lib/ruby/gems/2.1.0/gems/childprocess-0.5.3/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/websocket-1.2.1/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.43.0/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/watir-webdriver-0.6.10/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/faker-1.4.3/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/yml_reader-0.3/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/data_magic-0.19/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/page_navigation-0.9/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/page-object-1.0.2/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/i18n-0.7.0.beta1/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/require_all-1.3.2/lib
C:/Ruby21/lib/ruby/site_ruby/2.1.0
C:/Ruby21/lib/ruby/site_ruby/2.1.0/i386-msvcrt
C:/Ruby21/lib/ruby/site_ruby
C:/Ruby21/lib/ruby/vendor_ruby/2.1.0
C:/Ruby21/lib/ruby/vendor_ruby/2.1.0/i386-msvcrt
C:/Ruby21/lib/ruby/vendor_ruby
C:/Ruby21/lib/ruby/2.1.0
C:/Ruby21/lib/ruby/2.1.0/i386-mingw32. Reverting to Ruby lexer.
No lexer was found for en (cannot load such file -- gherkin/lexer/en). Supported
 languages are listed in gherkin/i18n.json. (Gherkin::I18n::LexerNotFound)
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/i18n.r
b:108:in `rescue in lexer'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/i18n.r
b:97:in `lexer'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/parser
/parser.rb:139:in `transition_table'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/parser
/parser.rb:128:in `build_transition_map'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/parser
/parser.rb:124:in `transition_map'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/parser
/parser.rb:91:in `initialize'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/parser
/parser.rb:68:in `new'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/parser
/parser.rb:68:in `push_machine'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/parser
/parser.rb:31:in `parse'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.17/lib/cucumber/feature_file.rb:
37:in `parse'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.17/lib/cucumber/runtime/features
_loader.rb:28:in `block in load'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.17/lib/cucumber/runtime/features
_loader.rb:26:in `each'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.17/lib/cucumber/runtime/features
_loader.rb:26:in `load'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.17/lib/cucumber/runtime/features
_loader.rb:14:in `features'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.17/lib/cucumber/runtime.rb:179:i
n `features'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.17/lib/cucumber/runtime.rb:49:in
 `run!'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.17/lib/cucumber/cli/main.rb:47:i
n `execute!'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.17/bin/cucumber:13:in `<top (req
uired)>'
C:/Ruby21/bin/cucumber:23:in `load'
C:/Ruby21/bin/cucumber:23:in `<main>'
luislavena commented 9 years ago

@anilreddy please read the Rubyinstaler announcement notes:

https://groups.google.com/d/topic/rubyinstaller/AnVOc_cosTw/discussion

Existing pre-compiled gems might not be Ruby 2.1 compatible

Ruby 2.1 introduces ABI breakage which means compiled C extensions with previous 1.9.3 or 2.0.0 will not run against Ruby 2.1.

DO NOT install Ruby 2.1 on top of existing Ruby 1.9.3 or 2.0.0, or try to use compiled extensions with it.

You will be required to force compilation of those gems:

 gem install <name> --platform=ruby

This will require you have the extra dependencies installed for that gem to compile. Look at the gem documentation for the requirements.

Please check each gem documentation and recent releases.

That means you need to do: gem install gherkin --platform=ruby to trigger compilation.

It will take time for gems to bundle binaries for Ruby 2.1, so please be patient.

aslakhellesoy commented 9 years ago

Gherkin 3 (work in progress) will be pure ruby, so these problems should go away when that happens. It will take several months before we're there though.

melikeercan commented 9 years ago

Hi Aslak,

Could you please tell us what version of cucumber/gherkin/ruby is compatible with each other, if we have 64 bit Windows 7? It is VERY hard to find the components that work together. Just an example would be great!

nhudacin commented 9 years ago

+1 for @melikeercan's comment... Cucumber has been pretty much unusable for us as a windows only shop because of this issue.

nhudacin commented 9 years ago

@melikeercan > After several hours wasted, and tons of tries.. I finally got cucumber to run on my system.

https://github.com/cucumber/gherkin/issues/273

@mscharley has a comment in the above thread that doing gem install gherkin --platform ruby would work on windows in combination with changing the prefix = '' in the c_lexer.rb file. This did not work for me AT FIRST...

I had to uninstall all of the previous gherkin gems which all threw an error about ill formatted specs. So I deleted all references/specs/gems/folders to gherkin and redid @mscharley's suggestion. Worked perfectly!

I got this idea from @jnyman in that same thread where the original version(s) of gherkin were compiled with mingw32. Hope this helps!

alpersilistre commented 8 years ago

Hi @nhudacin Could you please explain or show how can you solve the issue or if anyone can help me on this repo. I could not run any android test on my machine because of this gherkin issue. I delete the gherkin 2.12.2 from gem folder and trying to install again with "gem install gherkin" but it always gives me error : Error installing gherkin: failed to build gem native extension etc. It also put the folder on the same location but when I run my test with "calabash-android run " its says gherkin not found.

nhudacin commented 8 years ago

@alpersilistre - For me, I had to remove the installed gherkin (it was named something like gherkin-2.12.1-x86-ming32). The ming32 x86 is what was causing the issue in my case. I needed the x64 compiled version.

gem uninstall gherkin --force

I have ChefDK installed which comes pre configured with the ruby dev kit needed. It sounds like you may not have the ruby dev kit or if you do, it's not configured correctly and probably isn't an issue with Gherkin. You will eventually need to install and compile the gherkin gem on the machine you're trying to run it on...

gem install gherkin --platform ruby 

The "--platform ruby" is important here. If you don't use this switch then you'll just download the x86 gem again.

alpersilistre commented 8 years ago

@nhudacin I solve the issue with this (at least I hope :D) But now I have #559 problem. Thank you for your concern.

weiserma commented 8 years ago

The uninstall / install worked for me Ruby 2.1.6

mattwynne commented 8 years ago

Please try Cucumber-Ruby 2.1 which uses the new Gherkin3 parser.