Skip to content

Instantly share code, notes, and snippets.

@proubits
Last active April 21, 2016 00:19
Show Gist options
  • Save proubits/11038352 to your computer and use it in GitHub Desktop.
Save proubits/11038352 to your computer and use it in GitHub Desktop.
Make RubyMine to run rspec/cucumber with Spork DRb Server
==Make RubyMine to run rspec/cucumber with Spork DRb Server
I was testing RubyMine 6.3 and encountered a problem when running spec file with Spork DRb Server running at the background. The Rspec test failed with the following error message:
no such file to load -- teamcity/spec/runner/formatter/teamcity/formatter (LoadError)
RubyMine can run the spec without problem if there's no DRb running.
I spent a lot of time researching the topic to fix it and couldn't find an exact solution for the problem. However from the online resources I was able to come out with a way to fix the problem. Basically, you need to tell RubyMine to run spork with load path for the formatter.
In RubyMine you can set the Run options for Spork. For RubyMine 6.3, go to menu <b>Run</b>...<b>Edit Configurations</b>..., select <b>Defaults</b>...<b>Spork DRb</b>. Now on the <i>Environment variables</i> add this "<tt>RUBYMINE_HOME=/path/to/your-ruby-mine/</tt>"(ignore the double quote), and on the <i>Ruby arguments</i>, append this to the end of the existing arguments "<tt> -I$RUBYMINE_HOME/rb/testing/patch/common/ -I$RUBYMINE_HOME/rb/testing/patch/bdd/</tt>"(excluding the double quote). Click OK, and you are done.
the <tt>-Idirectory</tt> is the ruby command line options to specify $LOAD_PATH directory.
@bguban
Copy link

bguban commented Aug 7, 2014

Hello
I found a solution for this problem in a comment by Oleg Sukhodolsky in this article http://blog.jetbrains.com/ruby/2014/04/rubymine-6-3-rails-4-1-slim-2-0-angularjs-and-more/

To solve the problem you just need to stop spring. Do it by command spring stop

@thewoolleyman
Copy link

FYI, I have a fix for this which avoids having to stop Spring: http://stackoverflow.com/a/36757377/25192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment