Open marklane2001 opened 7 years ago
@marklane2001 It might be a little late for this, but... did you use bundle exec
when you ran the features?
got the same issue, what i did was clean all gems beside the default gem come with ruby by running "gem uninstall --all " and run "bundle install" using gemfile.
Hi I used Testgen to create my skeleton files but I seem to be having a problem with the hook file. File is: require 'watir'
Before do @browser = Watir::Browser.new :chrome end
After do @browser.close end
When I run the puppies feature file I get the following error:
cannot load such file -- watir (LoadError) /Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require' /Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' /Users/marklane/RubymineProjects/test_puppies/features/support/hooks.rb:2:in <top (required)>' /Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:inload' /Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:in load_code_file' /Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:171:inload_file' /Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:83:in block in load_files!' /Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:ineach' /Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:in load_files!' /Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:175:inload_step_definitions' /Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:40:in run!' /Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:43:inexecute!' /Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:20:in execute' /Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/bin/cucumber:14:in' /Users/marklane/.rbenv/versions/1.9.3-p194/bin/cucumber:23:in load' /Users/marklane/.rbenv/versions/1.9.3-p194/bin/cucumber:23:in' -e:1:in load' -e:1:in'
My Gem File Lock is:
GEM remote: https://rubygems.org/ specs: backports (3.10.3) builder (3.2.3) childprocess (0.8.0) ffi (~> 1.0, >= 1.0.11) concurrent-ruby (1.0.5) cucumber (3.0.1) builder (>= 2.1.2) cucumber-core (~> 3.0.0) cucumber-expressions (~> 4.0.3) cucumber-wire (~> 0.0.1) diff-lcs (~> 1.3) gherkin (~> 4.0) multi_json (>= 1.7.5, < 2.0) multi_test (>= 0.1.2) cucumber-core (3.0.0) backports (>= 3.8.0) cucumber-tag_expressions (>= 1.0.1) gherkin (>= 4.1.3) cucumber-expressions (4.0.4) cucumber-tag_expressions (1.0.1) cucumber-wire (0.0.1) data_magic (1.2) faker (>= 1.1.2) yml_reader (>= 0.6) diff-lcs (1.3) faker (1.8.4) i18n (~> 0.5) ffi (1.9.18) gherkin (4.1.3) i18n (0.9.0) concurrent-ruby (~> 1.0) multi_json (1.12.2) multi_test (0.1.2) page-object (2.2.4) page_navigation (>= 0.10) selenium-webdriver (~> 3.0) watir (~> 6.8) page_navigation (0.10) data_magic (>= 0.22) rake (12.2.1) rspec (3.7.0) rspec-core (~> 3.7.0) rspec-expectations (~> 3.7.0) rspec-mocks (~> 3.7.0) rspec-core (3.7.0) rspec-support (~> 3.7.0) rspec-expectations (3.7.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.7.0) rspec-mocks (3.7.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.7.0) rspec-support (3.7.0) rubyzip (1.2.1) selenium-webdriver (3.6.0) childprocess (~> 0.5) rubyzip (~> 1.0) watir (6.8.4) selenium-webdriver (~> 3.4, >= 3.4.1) yml_reader (0.7)
PLATFORMS ruby
DEPENDENCIES cucumber data_magic page-object (~> 2.0) rake rspec watir
I am unsure why this error is occurring when I have Watir installed. When I require Watir and run the script just using the ruby file then it works ok. As soon as do the same using the Feature it errors.
Any help would be greatly appreciated
Thanks