Skip to content

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

Open
@hakanai

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions