Skip to content


Subversion checkout URL

You can clone with
Download ZIP


cannot load such file -- spec_helper #178

berzinskar opened this Issue · 5 comments

4 participants


When I run the tests from terminal, everything works fine.
But when I run the tests from sublime, then I get an error:

/home/karlis/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- spec_helper (LoadError)
from /home/karlis/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
from /home/karlis/workspace/Rails/sample_app/spec/models/user_spec.rb:1:in <top (required)>'
from /home/karlis/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.0/lib/rspec/core/configuration.rb:896:in
from /home/karlis/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.0/lib/rspec/core/configuration.rb:896:in block in load_spec_files'
from /home/karlis/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.0/lib/rspec/core/configuration.rb:896:in
from /home/karlis/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.0/lib/rspec/core/configuration.rb:896:in load_spec_files'
from /home/karlis/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.0/lib/rspec/core/command_line.rb:22:in
from /home/karlis/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.0/lib/rspec/core/runner.rb:80:in run'
from /home/karlis/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.0/lib/rspec/core/runner.rb:17:in
block in autorun'
[Finished in 0.2s with exit code 1]

I have done the rspec:install and the spec_helper is under the spec folder. Any ideas why it isn't working?


I have the same issue. I'm guessing a configuration problem somewhere, maybe RVM since we both appear to use that. Not sure what the solution is though.


Running into this as well, using rbenv


Was running into this until I re-opened my project using command line.
cd ~/path/to/your/project
subl ./

Tests are now running fine.


Thank you kurtfunai.
The problem for me was that if I add a folder to the project under which I have many Rails projects it wasn't working. If I add add projects to Sublime workspace one by one, everything works. Don't know why is that because it used to work if you had many projects under one folder added to workspace.


Hi, I know this conversation has been quiet for a while, but I'll add a further bit of info because I also came up against the same error.

First, because I was using rbenv I adjusted the setting in my User preferences for RubyTest, so it was at least pointing to the right ruby.

Second, and this was the problem for me, when I opened ST using subl ./ it found spec_helper.rb fine and the tests worked, but it hadn't opened my ST project file. It had opened the folder that was the root of the Rails project. My ST project folder had its root one folder above in the file hierarchy. I knew it was a path problem from the start, and that fixed it. And now I don't have to open ST from Terminal, from the Finder is ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.