`require': cannot load such file --./spec_helper (LoadError)

I’m going through Ruby on Rails book…and trying to load Rspec for
static pages. I’ve looked on stack overflow and have tried what was
recommended, such as changing the folder name to features, and adding
require ‘capybara’ to the spec_helper folder, but to no avail.

My directory is:
Spec (folder)
features (folder)

Here is the code for 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')


When I change the folder name back to ‘requests’ and remove require
capybara from spec_helper.rb I just get the failed test:


  1. Static pages Home page should have the content ‘Sample App’
    Failure/Error: visit ‘/static_pages/home’

    undefined method `visit’ for

    ./spec/features/static_pages_spec.rb:7:in `block (3 levels) in

<top (required)>’

Finished in 0.00102 seconds (files took 0.15198 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/features/static_pages_spec.rb:6 # Static pages Home page
should have the content 'Sample App

the test seems to have a problem with the following line in my
static_pages_spec.rb file:

visit ‘/static_pages/home’