Mac OSX 10.7.2,
Following a rails tutorial and have come to an error when:
rspec spec/
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- spec_helper (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /Users/lasernite/rails_projects/sample_app/spec/controllers/pages_controller_spec.rb:1
from /Library/Ruby/Gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in `load'
from /Library/Ruby/Gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in `load_spec_files'
from /Library/Ruby/Gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in `map'
from /Library/Ruby/Gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in `load_spec_files'
from /Library/Ruby/Gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:22:in `run'
from /Library/Ruby/Gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in `run_in_process'
from /Library/Ruby/Gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in `run'
from /Library/Ruby/Gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `autorun'
from /usr/bin/rspec:19
I have no idea how to solve this problem, but the real problem is not this specific problem (though it is one) but the inability to solve these types of problem. Is there any troubleshooting resources where I can learn to read feedback like this, because I can’t really understand this syntax to figure out where the problem is.
Tis is what my gemfile looks like, it might be too bare as I deleted some things I thought were creating compatibility issues.
source ‘http://rubygems.org’
gem 'rails', '~> 3.0.0'
gem 'sqlite3-ruby', '~> 1.2.5', :require => 'sqlite3'
group :development do
gem 'rspec-rails', '~> 2.0.1'
end
group :test do
gem 'rspec', '~> 2.0.1'
gem 'webrat', '~> 0.7.1'
end
The real error here is “no such file to load — spec_helper” (the first line of the exception message. You have an rspec file that is trying to load “spec_helper” and it does not exist.
To solve this problem:
bundle exec rails generate rspec:install
This will create the spec_helper file for you.