Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9005803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:14:31+00:00 2026-06-16T01:14:31+00:00

I’m doing the Ruby On Rails 3 Tutorial (Learn Rails By Example) by Michael

  • 0

I’m doing the Ruby On Rails 3 Tutorial (Learn Rails By Example) by Michael Hartl book.

I’m on chapter 3, and my output isn’t what Michael has in the book. Can someone help?

admin@new-host:~/Desktop/sample_app$ rspec spec/
Exception encountered: #<NameError: uninitialized constant PagesController>
backtrace:
/Users/admin/Desktop/sample_app/spec/controllers/pages_controller_spec.rb:3:in `<top (required)>'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `block in load_spec_files'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `each'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `load_spec_files'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.12.2/lib/rspec/core/command_line.rb:22:in `run'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/spork-0.9.2/lib/spork/test_framework/rspec.rb:11:in `run_tests'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:13:in `block in run'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/spork-0.9.2/lib/spork/forker.rb:21:in `block in initialize'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/spork-0.9.2/lib/spork/forker.rb:18:in `fork'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/spork-0.9.2/lib/spork/forker.rb:18:in `initialize'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:9:in `new'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:9:in `run'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/spork-0.9.2/lib/spork/server.rb:48:in `run'
/Users/admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
/Users/admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'
/Users/admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
/Users/admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
/Users/admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'

spec_helper.rb:

require 'rubygems'
require 'spork'
#uncomment the following line to use spork with the debugger
#require 'spork/ext/ruby-debug'

Spork.prefork do
  # Loading more in this block will cause your tests to run faster. However,
  # if you change any configuration or code from libraries loaded here, you'll
  # need to restart spork for it take effect.
  ENV["RAILS_ENV"] ||= 'test'
  unless defined?(Rails)
    require File.dirname(__FILE__) + "/../config/environment"
  end

  require 'rspec/rails'

  # Requires supporting ruby files with custom matchers and macros, etc,
  # in spec/support/ and its subdirectories.
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}

  RSpec.configure do |config|
    # == Mock Framework
    #
    # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
    #
    # config.mock_with :mocha
    # config.mock_with :flexmock
    # config.mock_with :rr
    config.mock_with :rspec

    # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
    config.fixture_path = "#{::Rails.root}/spec/fixtures"

    # If you're not using ActiveRecord, or you'd prefer not to run each of your
    # examples within a transaction, remove the following line or assign false
    # instead of true.
    config.use_transactional_fixtures = true

    ActiveSupport::Dependencies.clear

  end


end

Spork.each_run do
  # This code will be run each time you run your specs.

end

based off of Ismael’s advice. I did this and got the following output:

admin@new-host:~/Desktop/sample_app$ rspec --pattern spec/*_spec.rb
Exception encountered: #<NameError: uninitialized constant PagesController>
backtrace:
/Users/admin/Desktop/sample_app/spec/controllers/pages_controller_spec.rb:3:in `<top (required)>'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `block in load_spec_files'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `each'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `load_spec_files'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.12.2/lib/rspec/core/command_line.rb:22:in `run'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/spork-0.9.2/lib/spork/test_framework/rspec.rb:11:in `run_tests'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:13:in `block in run'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/spork-0.9.2/lib/spork/forker.rb:21:in `block in initialize'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/spork-0.9.2/lib/spork/forker.rb:18:in `fork'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/spork-0.9.2/lib/spork/forker.rb:18:in `initialize'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:9:in `new'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:9:in `run'
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/spork-0.9.2/lib/spork/server.rb:48:in `run'
/Users/admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
/Users/admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'
/Users/admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
/Users/admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
/Users/admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'

admin@new-host:~/Desktop/sample_app$ autotest
loading autotest/rails_rspec2
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/ZenTest-4.8.3/lib/autotest.rb:315:in `load': /Users/admin/Desktop/sample_app/.autotest:3: unterminated string meets end of file (SyntaxError)
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/ZenTest-4.8.3/lib/autotest.rb:315:in `block in initialize'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/ZenTest-4.8.3/lib/autotest.rb:314:in `each'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/ZenTest-4.8.3/lib/autotest.rb:314:in `initialize'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.12.2/lib/autotest/rspec2.rb:13:in `initialize'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-rails-2.12.0/lib/autotest/rails_rspec2.rb:31:in `initialize'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/ZenTest-4.8.3/lib/autotest.rb:244:in `new'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/ZenTest-4.8.3/lib/autotest.rb:244:in `run'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/ZenTest-4.8.3/bin/autotest:6:in `<top (required)>'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/bin/autotest:19:in `load'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/bin/autotest:19:in `<main>'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `<main>'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:14:32+00:00Added an answer on June 16, 2026 at 1:14 am

    replace code in spec_helper with this code: https://raw.github.com/railstutorial/sample_app/master/spec/spec_helper.rb

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.