new to ruby and rubymine... can't get rspec to run

I'm trying to follow this tutorial with rubymine (http://ruby.railstutorial.org/chapters/static-pages#sec-TDD) and was having some trouble getting the rspec to run.  I think I finally figured out how to do it (shift+F10) but when I try I get the following errors. And being new to all of this I'm not sure why.  Can anyone offer a suggestion?  Thanks.

/home/geoff/.rvm/rubies/ruby-1.9.3-p327/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/geoff/.rvm/gems/ruby-1.9.3-p327/bin/rake spec
Testing started at 8:15 PM ...
/home/geoff/.rvm/rubies/ruby-1.9.3-p327/bin/ruby -S rspec ./spec/requests/static_pages_spec.rb
/home/geoff/RubymineProjects/sample_app/spec/requests/static_pages_spec.rb:1:in `require': cannot load such file -- spec_helper (LoadError)
 from /home/geoff/RubymineProjects/sample_app/spec/requests/static_pages_spec.rb:1:in `<top (required)>'
 from /home/geoff/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load'
 from /home/geoff/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `block in load_spec_files'
 from /home/geoff/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `map'
 from /home/geoff/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load_spec_files'
 from /home/geoff/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:22:in `run'
 from /home/geoff/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
 from /home/geoff/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'
rake aborted!
/home/geoff/.rvm/rubies/ruby-1.9.3-p327/bin/ruby -S rspec ./spec/requests/static_pages_spec.rb failed
/home/geoff/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.11.1/lib/rspec/core/rake_task.rb:137:in `block (2 levels) in initialize'
/home/geoff/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.11.1/lib/rspec/core/rake_task.rb:127:in `block in initialize'
-e:1:in `load'
-e:1:in `<main>'
Tasks: TOP => spec
(See full trace by running task with --trace)

Process finished with exit code 1
Empty test suite.





and here's the rspec file

require 'spec_helper'

describe "Static Pages" do
  describe "Home page" do
    it "should have the content 'Sample App'" do
      visit '/static_pages/home'
      page.should have_content('Sample App')
    end
  end
end
0
3 comments
Avatar
Permanently deleted user

Hi,

it looks like the test just unable to load spec_helper.rb, most likely it is supposed to add spec directory to ruby library path (-Ispec)
You could do this by editing the run configuration you use.
If this won't help (or you will be unable to change it) please show the run configuration's settings.

Regards, Oleg.

0

I'm sory but I'm not sure what I need to do to "add spec directory to ruby library path (-Ispec)"  What configuration settings do you want to see?  I'm assuming you're referring to Run > Edit Configurations >RSpec > static_pages_spec?  But if so, what all do you want to know?  Thanks.

0
Avatar
Permanently deleted user

To add spec to ruby library path you need to prepend "-Ispec" to "Ruby arguments" of the run configuration.
Also you might need to check if working directory is the expected one (I usually use project's root dir).
As for settings:I'm attaching screenchot of settings which are most interesting in this case.

Hope this helps, Oleg.



Attachment(s):
rspec-test-config.png
1

Please sign in to leave a comment.