/var/lib/gems/2.2.0/gems/allure-rspec-0.6.9/lib/allure-rspec/formatter.rb:41:in `start': uninitializ

139 views
Skip to first unread message

kumar vinukonda

unread,
Mar 30, 2015, 11:07:53 AM3/30/15
to rs...@googlegroups.com
I am hitting with the following issue when I try the code in the link http://elementalselenium.com/tips/59-html-reporting.


~/Registria/elementalseleniumtest$ rspec reporting_spec.rb 
/var/lib/gems/2.2.0/gems/allure-rspec-0.6.9/lib/allure-rspec/formatter.rb:41:in `start': uninitialized constant AllureRSpec::Formatter::Pathname (NameError)
from /var/lib/gems/2.2.0/gems/rspec-core-3.2.1/lib/rspec/core/reporter.rb:146:in `block in notify'
from /var/lib/gems/2.2.0/gems/rspec-core-3.2.1/lib/rspec/core/reporter.rb:145:in `each'
from /var/lib/gems/2.2.0/gems/rspec-core-3.2.1/lib/rspec/core/reporter.rb:145:in `notify'
from /var/lib/gems/2.2.0/gems/rspec-core-3.2.1/lib/rspec/core/reporter.rb:73:in `start'
from /var/lib/gems/2.2.0/gems/rspec-core-3.2.1/lib/rspec/core/reporter.rb:60:in `report'
from /var/lib/gems/2.2.0/gems/rspec-core-3.2.1/lib/rspec/core/runner.rb:108:in `run_specs'
from /var/lib/gems/2.2.0/gems/rspec-core-3.2.1/lib/rspec/core/runner.rb:86:in `run'
from /var/lib/gems/2.2.0/gems/rspec-core-3.2.1/lib/rspec/core/runner.rb:70:in `run'
from /var/lib/gems/2.2.0/gems/rspec-core-3.2.1/lib/rspec/core/runner.rb:38:in `invoke'
from /var/lib/gems/2.2.0/gems/rspec-core-3.2.1/exe/rspec:4:in `<top (required)>'
from /usr/local/bin/rspec:23:in `load'
from /usr/local/bin/rspec:23:in `<main>'


Can someone help me in resolving the issue.

Regards
Kumar Vinukonda

Myron Marston

unread,
Mar 30, 2015, 11:12:42 AM3/30/15
to rs...@googlegroups.com
The error is being raised because allure-rspec's formatter relies upon pathname from the Ruby stdlib, but it isn't requiring it.  You can work around this by adding a `require 'pathname'` to your `spec_helper.rb` file.  You should probably also report it to allure-rspec so they can add the require there as it really belongs there.

HTH,
Myron

kumar vinukonda

unread,
Mar 30, 2015, 1:40:34 PM3/30/15
to rs...@googlegroups.com
Hi Myron,
  thanks a ton. It solved the problem.

Regards
Kumar

Natarajan Krishnamurthy

unread,
Feb 17, 2016, 2:32:51 PM2/17/16
to rspec, vvss...@gmail.com
Hi Kumar,
I am getting the same error like yours :

C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/allure-rspec-0.7.5/lib/allure-rspec/formatter.rb:42:in `start': uninitialized constant AllureRSpec::Formatter::Pathname (NameError)
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.2/lib/rspec/core/reporter.rb:189:in `block in notify'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.2/lib/rspec/core/reporter.rb:188:in `each'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.2/lib/rspec/core/reporter.rb:188:in `notify'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.2/lib/rspec/core/reporter.rb:88:in `start'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.2/lib/rspec/core/reporter.rb:75:in `report'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.2/lib/rspec/core/runner.rb:117:in `run_specs'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.2/lib/rspec/core/runner.rb:93:in `run'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.2/lib/rspec/core/runner.rb:78:in `run'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.2/lib/rspec/core/runner.rb:45:in `invoke'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.2/exe/rspec:4:in `<top (required)>'
        from C:/Ruby22-x64/bin/rspec:23:in `load'
        from C:/Ruby22-x64/bin/rspec:23:in `<main>'

Can you explain me the steps you took to fix this please?

Thanks
Krish

Jon Rowe

unread,
Feb 17, 2016, 6:09:54 PM2/17/16
to rs...@googlegroups.com
Krish

Kumar would have added a `require ‘pathname’` to the top of his `spec/spec_helper.rb` as Myron suggested.

Regards
Jon Rowe
---------------------------

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/7a5fbc38-66f0-46af-ba03-86633edbf128%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages