Search code examples
ruby-on-railsrspec-rails

rspec core configuration error: 'load':cannot load such file


I am new to rails and I am studying a tutorial. While i was trying to test a sample app with RSpec, I got the following error:

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:896:in `load': 
cannot load such file -- 
C:/Sites/sample_app/spec/requests/static_pages.rb (LoadError)

I have installed the required gem and I am running the command bundle exec rspec spec\requests\static_pages.rb in the folder oof my app. My Gemfile is as follows:

source 'https://rubygems.org'

gem 'rails', '4.0.0.rc2'
group :development, :test do
  gem 'sqlite3'
  gem 'rspec-rails'
end
gem 'sass-rails', '~> 4.0.0.rc2'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'

group :doc do
  gem 'sdoc', require: false
end

group :test do
  gem 'capybara'
end

I am running on windows 7 Ultimate 64bit. Please help :) I could not find a solution on the net..


Solution

  • I got the same problem. I am using ubuntu. One silly mistake I did was, after changing the home.html.erb file and added 'Sample App' in them, we tend to run the test immediately, never do that. Come to the main directory(do couple of cd ..) and run the full command.

    This is a very silly mistake which I made took me some 5 minutes to realize. I am sure this will help someone else like me if not you.