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 3691838
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:11:34+00:00 2026-05-19T04:11:34+00:00

I have a Page scaffold that I created through rails generate scaffold. I ran

  • 0

I have a Page scaffold that I created through rails generate scaffold. I ran rake db:migrate, and viewing the database through SQLite Database Browser reveals that it in fact exists. I can go to the rails console and run:


    Page.all.each {|page| puts page.url}

When I run this, it in fact returns the right results (e.g., the value of url for each record of Page.

What I am trying to do is set up an rspec test in my pages controller test to see that each of the routes I’ve set up in config/routes.rb actually works. So I have a test defined in spec/controllers/pages_controller_spec.rb as follows:


describe PagesController do

    Page.all.each do |page|
        describe "GET /#{page.url}" do
            it "should be able to get at page at #{page.url}" do
                get "/#{page.url}"
                response.should be_successful
            end
        end
    end

end

This test does not run. Instead, it generates the following message:


C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:202:in `rescue in log': SQLite3::SQLException: no such table: pages: SELECT     "pages".* FROM       "pages" (ActiveRecord::StatementInvalid)

Does anyone know what is going on? Or, in the alternative, does anyone know why this will work in my Rails Console, but not in my rspec tests?

Thank you so much. I am relatively new to Rails, so still learning a lot!

  • 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-05-19T04:11:35+00:00Added an answer on May 19, 2026 at 4:11 am

    Run rake db:test:prepare to make sure the database schema is setup in the test environment.

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

Sidebar

Related Questions

I have created model, view and controller: $ rails generate scaffold Post name:string title:string
I have a Pyramid app that I've been developing and viewing locally through http://localhost:6543
I have a controller called 'exposures' which I created automatically with the script/generate scaffold
Say I have simply ran rails g scaffold book name:string about:text On the 'show'
I have a website that does not have page refreshes when the visitor navigates
I have a page that takes a few minutes to run. When I set
I have a page that, depending on input from a previous page, lists a
Created new scaffold Users that has fields name & description All working as suppose
I have page that is receiving a query string and I want it so
I have page that creates a table: http://gupii.co.uk/rap/weekTable.php and I'm using a plugin to

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.