Spring and Rspec broken in latest Rubymine version

Answered

Hi,

Problem :

When i run a rspec test i get a "cannot load such file -- teamcity/spec/runner/formatter/teamcity/formatter (LoadError)"

If i run the same test in debug mode it works.

Steps to reproduce :

- Start Rubymine

- Clic run rspec

 

More info :

Untill i updated to Rubymine 2016.2.1 i used to have this error randomly. I was able to solve it by killing spring in the console (`spring stop`) => http://stackoverflow.com/questions/24525945/running-a-spec-in-rubymine-results-in-cannot-load-such-file-teamcity-spec-ru

Since i updated Rubymine this doesn't work anymore. I cant run rspec anymore unless i use debug mode even if i disable spring in the run configuration (use pre-load server: none)

Right now i'm forced to run the spec outside of rubymine in the terminal which is a huge pain :(

What can i do to run the rspec without debug mode ?

 

Config :

 

  • RubyMine 2016.2.1 - Build #RM-162.1447.29
  • Ruby 2.3.1p112
  • rails 4.2.6
  • spec-rails (3.4.0)
  • OSX 10.11.6

 

 

Here is my run configuration : 

Thanks for this amazing tool by the way :)

Vincent

6 comments

Hello, Vincent,

could you please try stopping spring manually (by running spring stop). How does it go in this case?

0

Same issue here.  

 

Even after I manually stop spring with spring stop, I have the same errors.

 

When I run rspec outside of RubyMine, it's fine. (ex:  > bundle exec rspec  )

0

@Ashley,

could you please specify what RubyMine version you're using (there was a similar issue, which is already fixed: https://youtrack.jetbrains.com/issue/RUBY-18207)

0

yes, i confirm that latest update solved the problem for me.

0

After upgrading IntelliJ IDEA to 2019.1 - this issue came again.

Now I cannot run rspec tests because it shows the following:

I see in the console that IntelliJ starts the rspec test with the following command line:

/bin/bash -c "/Users/maris/.rvm/bin/rvm ruby-2.4.5 do bundle exec /Users/maris/.rvm/rubies/ruby-2.4.5/bin/ruby /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/bin/rspec /Users/maris/Documents/Code/app/spec/my-test_spec.rb --require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter --example \"My Test\""

It shows that test has (-) finished but with no result.

If I try to run the same command in the command line, I see the following output:

An error occurred while loading teamcity/spec/runner/formatter/teamcity/formatter.
Failure/Error: load_dependency(file) { result = super }

LoadError:
cannot load such file -- teamcity/spec/runner/formatter/teamcity/formatter
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/configuration.rb:2034:in `load_file_handling_errors'
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/configuration.rb:1519:in `block in requires='
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/configuration.rb:1519:in `each'
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/configuration.rb:1519:in `requires='
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/configuration_options.rb:113:in `block in process_options_into'
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/configuration_options.rb:112:in `each'
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/configuration_options.rb:112:in `process_options_into'
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/configuration_options.rb:22:in `configure'
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:127:in `configure'
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:97:in `setup'
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:86:in `run'
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:71:in `run'
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:45:in `invoke'
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/exe/rspec:4:in `<top (required)>'
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/bin/rspec:23:in `load'
# /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/bin/rspec:23:in `<main>'
#
# Showing full backtrace because every line was filtered out.
# See docs for RSpec::Configuration#backtrace_exclusion_patterns and
# RSpec::Configuration#backtrace_inclusion_patterns for more information.
/Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require': cannot load such file -- spec/runner/formatter/teamcity_formatter (LoadError)
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters.rb:231:in `rescue in custom_formatter'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters.rb:228:in `custom_formatter'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters.rb:181:in `find_formatter'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters.rb:150:in `add'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/configuration.rb:942:in `add_formatter'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/configuration_options.rb:118:in `block in load_formatters_into'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/configuration_options.rb:118:in `each'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/configuration_options.rb:118:in `load_formatters_into'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/configuration_options.rb:24:in `configure'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:127:in `configure'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:97:in `setup'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:86:in `run'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:71:in `run'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:45:in `invoke'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/gems/rspec-core-3.8.0/exe/rspec:4:in `<top (required)>'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/bin/rspec:23:in `load'
from /Users/maris/.rvm/rubies/ruby-2.4.4/gems/ruby/2.4.0/bin/rspec:23:in `<main>'

 

Question:

1. Why is IntelliJ adding the parameters

--require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter

to the rspec command?

2. How to fix this?

 

Stopping spring, killing spring, restarting IntelliJ, restarting computer - nothing helps.

 

Loving the IntelliJ by the way!

0

Hello,

that appears to be a known issue: https://youtrack.jetbrains.com/issue/RUBY-23459

The fix will be most likely available in RubyMine 2019.1.1 and in the updated Ruby plugin for IDEA 2019.1.1

0

Please sign in to leave a comment.