Running rspec for the first time with the Rails tutorial, p. 95. Getting this output:
david@david-desktop:~/rails_projects/sample_app1$ bundle exec rspec /spec/requests/static_pages_spec.rb
/home/david/.rvm/gems/ruby-1.9.3-p362@rails3tutorial2nded/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load': cannot load such file -- /spec/requests/static_pages_spec.rb (LoadError)
from /home/david/.rvm/gems/ruby-1.9.3-p362@rails3tutorial2nded/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `block in load_spec_files'
from /home/david/.rvm/gems/ruby-1.9.3-p362@rails3tutorial2nded/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `map'
from /home/david/.rvm/gems/ruby-1.9.3-p362@rails3tutorial2nded/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load_spec_files'
from /home/david/.rvm/gems/ruby-1.9.3-p362@rails3tutorial2nded/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:22:in `run'
from /home/david/.rvm/gems/ruby-1.9.3-p362@rails3tutorial2nded/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:69:in `run'
from /home/david/.rvm/gems/ruby-1.9.3-p362@rails3tutorial2nded/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:10:in `block in autorun'
Here is Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.9.0'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.4'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platform => :ruby
end
gem 'jquery-rails'
group :test do
gem 'capybara', '1.1.2'
end
Have already done the rails generate rspec:install and rails generate integration_test static_pages commands. Ideas?
Drop the leading slash in the filename:
bundle exec rspec spec/requests/static_pages_spec.rb
Just FYI - I have also experienced this when my spec file wasn't formatted properly. I was missing a "DO"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With