(Using Hartl’s Tutorial)
I went through chapter 3 without any problems using rspec to test but after I finished up the section, merged branches, etc – I can no longer run the rspec tests. I’m on chapter 4 trying to do the first set of testing but I get the follow error:
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.10.1/lib/rspec
/core/configuration.rb:746:inload': C:/Sites/rails_projects/sample_app/spec/reblock in load_spec_files’
quests/static_pages_spec.rb:61: syntax error, unexpected $end, expecting keyword
_end (SyntaxError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
0.1/lib/rspec/core/configuration.rb:746:in
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
0.1/lib/rspec/core/configuration.rb:746:inmap'load_spec_files’
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
0.1/lib/rspec/core/configuration.rb:746:in
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
0.1/lib/rspec/core/command_line.rb:22:inrun'run’
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
0.1/lib/rspec/core/runner.rb:69:in
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
0.1/lib/rspec/core/runner.rb:10:in `block in autorun’
What could be the problem? I tried running rails generate rspec:install and tried again but with no luck.
first there is a syntax error in the static_pages_spec.rb file…that you need to fix…you should check Hartl’s code for the proper syntax…
second, ensure that you are running rspec from the app’s root directory…which in probably called sample_app in Hartl’s tutorial…
if none of these works, then you should give rpsec and absolute path starting from C:/…
let me know if it works..