1

I'm using a JRUBY/Cucumber/Watir framework and I have one specific features folder that keeps throwing this error every I try to use the built in HTML formatter:

    uninitialized constant Syntax::Ruby::Set
    Error creating formatter: html (NameError)
    org/jruby/RubyModule.java:2690:in `const_missing'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/syntax-1.2.0/lib/syntax         /lang/ruby.rb:11:in `Ruby'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/syntax-1.2.0/lib/syntax  /lang/ruby.rb:8:in `Syntax'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/syntax-1.2.0/lib/syntax/lang/ruby.rb:3:in `(root)'
    org/jruby/RubyKernel.java:1083:in `require'
    /Users/Casey.Guerrero/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55:in `require'
    /Users/Casey.Guerrero/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:53:in `require'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/syntax-1.2.0/lib/syntax.rb:1:in `(root)'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/syntax-1.2.0/lib/syntax.rb:24:in `load'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/syntax-1.2.0/lib/syntax/convertors/abstract.rb:16:in `for_syntax'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/formatter/html.rb:580:in `SnippetExtractor'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/formatter/html.rb:578:in `Html'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/formatter/html.rb:8:in `Formatter'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/formatter/html.rb:7:in `Cucumber'
org/jruby/RubyKernel.java:1083:in `require'
    /Users/Casey.Guerrero/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55:in `require'
    /Users/Casey.Guerrero/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:53:in `require'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/formatter/html.rb:6:in `(root)'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/constantize.rb:1:in `(root)'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/constantize.rb:17:in `constantize'
    org/jruby/RubyArray.java:2409:in `map'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/cli/configuration.rb:81:in `formatter_class'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/cli/configuration.rb:182:in `formatters'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/cli/configuration.rb:178:in `formatters'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/cli/configuration.rb:76:in `build_tree_walker'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/runtime.rb:46:in `run!'
    org/jruby/RubyKernel.java:1099:in `load'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/cli/main.rb:47:in `execute!'
    org/jruby/RubyKernel.java:1119:in `eval'
    /Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/bin/jruby_executable_hooks:15:in `(root)'

Using cucumber-1.3.14 and jruby-1.7.10 , although the error occurs with jruby-1.7.4. There are no formatters included in the support directory or referenced anywhere in the env.rb. Not using rake or anything ust running individual features. The strange thing is that other feature folders can output html reports with the same command arguments as the one that fails. Example:

cucumber features/AddText.feature -f html -o report.html -f pretty 

or

cucumber features/AddText.feature --format html --out report.html --format pretty

Any insight would be helpful.

UPDATE:

For some reason uninstalling then 'syntax' gem allows features to run and html reports to be generated. I was under the impression that 'syntax' was a 'cucumber' dependency...

caseygrr
  • 11
  • 4

3 Answers3

3

When a test failure occurs in Cucumber, the following line is written to the console:

# gem install syntax to get syntax highlighting

Unfortunately, this causes people to install the syntax gem, which is the cause of your error.

Do 'gem uninstall syntax' or 'sudo gem uninstall syntax' to avoid this error.

p.s.w.g
  • 146,324
  • 30
  • 291
  • 331
0

Run "gem uninstall syntax" this will work

Amalka
  • 91
  • 1
0

i know this is bit old thread, but would like to clear somethings out.

cucumber 1.3.17 and 1.3.18 dependent on syntax >= 1.0.0

and in the current case, problem is syntax 1.2.0 and not all version of syntax.

so what we should do is

uninstall syntax 1.2.0 and install syntax 1.0.0

sudo gem install syntax -v 1.0.0
Oxi
  • 2,918
  • 17
  • 28