1
votes

My Problem / Question

I am unable to run the very basic rspec test in listing 3.9 I feel like I am missing something very basic which is causing the static_pages_spec to return a LoadError. Does anyone have an idea what is going wrong?

The Error

E:\CSProj\RailsTutorial\sample_app>bundle exec rspec spec/request/static_pages_s pec.rb C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec /core/configuration.rb:780:in load': cannot load such file -- E:/CSProj/RailsTu torial/sample_app/spec/request/static_pages_spec.rb (LoadError) from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1 1.1/lib/rspec/core/configuration.rb:780:inblock in load_spec_files' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1 1.1/lib/rspec/core/configuration.rb:780:in map' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1 1.1/lib/rspec/core/configuration.rb:780:inload_spec_files' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1 1.1/lib/rspec/core/command_line.rb:22:in run' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1 1.1/lib/rspec/core/runner.rb:69:inrun' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1 1.1/lib/rspec/core/runner.rb:8:in `block in autorun'

The Code

I am using the following code: https://github.com/adoliver/sample_app/blob/static-pages/spec/requests/static_pages_spec.rb

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

Some information about my development environment

Windows 7 Used railsInstaller Using windows native command line Previous steps in the tutorial worked.

E:\CSProj\RailsTutorial\sample_app>ruby -v ruby 1.9.3p125 (2012-02-16) [i386-mingw32]

E:\CSProj\RailsTutorial\sample_app>rails -v Rails 3.2.9

My bundles:

E:\CSProj\RailsTutorial\sample_app>bundle list Gems included by the bundle:

  • actionmailer (3.2.9)
  • actionpack (3.2.9)
  • activemodel (3.2.9)
  • activerecord (3.2.9)
  • activeresource (3.2.9)
  • activesupport (3.2.9)
  • arel (3.0.2)
  • builder (3.0.4)
  • bundler (1.0.22)
  • capybara (1.1.2)
  • childprocess (0.3.6)
  • coffee-rails (3.2.2)
  • coffee-script (2.2.0)
  • coffee-script-source (1.4.0)
  • diff-lcs (1.1.3)
  • erubis (2.7.0)
  • execjs (1.4.0)
  • ffi (1.2.0)
  • hike (1.2.1)
  • i18n (0.6.1)
  • journey (1.0.4)
  • jquery-rails (2.0.2)
  • json (1.7.5)
  • libwebsocket (0.1.6.1)
  • mail (2.4.4)
  • mime-types (1.19)
  • multi_json (1.3.7)
  • nokogiri (1.5.5)
  • polyglot (0.3.3)
  • rack (1.4.1)
  • rack-cache (1.2)
  • rack-ssl (1.3.2)
  • rack-test (0.6.2)
  • rails (3.2.9)
  • railties (3.2.9)
  • rake (10.0.2)
  • rdoc (3.12)
  • rspec (2.11.0)
  • rspec-core (2.11.1)
  • rspec-expectations (2.11.3)
  • rspec-mocks (2.11.3)
  • rspec-rails (2.11.0)
  • rubyzip (0.9.9)
  • sass (3.2.3)
  • sass-rails (3.2.5)
  • selenium-webdriver (2.26.0)
  • sprockets (2.2.1)
  • sqlite3 (1.3.5)
  • thor (0.16.0)
  • tilt (1.3.3)
  • treetop (1.4.12)
  • tzinfo (0.3.35)
  • uglifier (1.2.3)
  • websocket (1.0.3)
  • xpath (0.1.4)
1

1 Answers

0
votes

You report:

load': cannot load such file -- E:/CSProj/RailsTu torial/sample_app/spec/request/static_pages_spec.rb (LoadError)

I don't know if this is silly, but the specs in my directory tree are in /app/spec/requests, not app/spec/request.