Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoadError: no such file to load -- ci/reporter/r_spec3/formatter, trying to use from bundler #164

Open
hakanai opened this issue May 23, 2017 · 2 comments

Comments

@hakanai
Copy link

hakanai commented May 23, 2017

For our Gemfile:

source 'https://rubygems.org'
gem 'rspec'
gem 'ci_reporter_rspec'

I get an error from RSpec:

     [java] LoadError: no such file to load -- ci/reporter/r_spec3/formatter
     [java]   org/jruby/RubyKernel.java:961:in `require'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/formatters.rb:222:in `custom_formatter'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/formatters.rb:172:in `find_formatter'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/formatters.rb:141:in `add'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/configuration.rb:767:in `add_formatter'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/configuration_options.rb:114:in `block in load_formatters_into'
     [java]   org/jruby/RubyArray.java:1734:in `each'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/configuration_options.rb:114:in `load_formatters_into'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/configuration_options.rb:23:in `configure'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/runner.rb:105:in `setup'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/runner.rb:92:in `run'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/runner.rb:78:in `run'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/runner.rb:45:in `invoke'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/exe/rspec:4:in `<main>'

It seems like RSpec has seen the "RSpec3" module name, and assumed that this would be in an "r_spec3" folder, but it is actually in "rspec3".

I tried to work around this by explicitly doing this:

gem 'ci_reporter_rspec', require: [ 'ci/reporter/rspec', 'ci/reporter/rspec3/formatter' ]

But this doesn't seem to change things.

Full command-line, in case it matters...

/path/to/jruby-9.1.9.0-complete.jar -S bundle exec rspec \
    --backtrace \
    --format documentation \
    --format CI::Reporter::RSpec3::Formatter \
    --format documentation --out "${reportdir}/specs.txt" \
    --format html --out "${reportdir}/specs.html" \
    "${arguments}"

The odd thing is, previously we were loading gems from a jar file, and that was working. Now I'm trying to move towards using bundler directly (less hacks), but it seems like it's failing to find things which it was previously finding.

@BrazhnykYuriy
Copy link

BrazhnykYuriy commented Sep 23, 2019

This is pretty old, but if someone get here, just require before use:

--require ci/reporter/rspec3/formatter
--format CI::Reporter::RSpec3::Formatter

@pboling
Copy link

pboling commented Mar 23, 2023

This can probably be closed @nicksieger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants