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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:32:33+00:00 2026-05-31T14:32:33+00:00

Environment is REE(2011.12) on rvm, rspec 2.8.0, rails 3.0.6, and pg 0.13.2. Using PostgreSQL

  • 0

Environment is REE(2011.12) on rvm, rspec 2.8.0, rails 3.0.6, and pg 0.13.2. Using PostgreSQL 8.3.17 on CentOS 5.6. The db:migrate have work correctly. But rspec have got following error.

1) ApiController articles OK
 Failure/Error: Unable to find matching line from backtrace
 ActiveRecord::StatementInvalid:
   PG::Error: ERROR:  relation "table_name" does not exist
   : DELETE FROM "table_name"

I’m updating my project from rails 2.3.5 with rspec 1.x series to rails 3.0 with rspec2. Copied all rspec tests, and I have merged old spec_helper.rb and new one(It was generated rails g rspec:install).

ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'

Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}

RSpec.configure do |config|

  config.fixture_path = "#{::Rails.root}/spec/fixtures"
  config.use_transactional_fixtures = true

end

I read similar question about this error.So I tried rake db:test:prepare or rake db:test:load, But It’s not resolve. Do you have any idea?
It looks like the test hasn’t run on test database… How do I do? 🙁

  • 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-31T14:32:34+00:00Added an answer on May 31, 2026 at 2:32 pm

    I’ve run into this in two instances (updated 6/13/2012):

    First:

    I haven’t yet migrated my test database…

    rake db:migrate

    …which you need to do before both db:test:prepare and db:test:load.

    When you invoke rspec it should prepare and load your database for you anyway. You shouldn’t have to do that by hand.

    Second:

    A typo in my migration. I accidentally reversed my table and column names in the parameter list.

    A migration on a Rails 3.1 project:

    def change
      add_column :had_import_errors, :studies, :boolean, :default => false
      add_column :import_data_cache, :studies, :text
    end
    

    …which is wrong, because has_import_errors and import_data_cache are my column names, and they therefore should come second, not first.

    The correct migration, with the table name first was:

    def change
      add_column :studies, :had_import_errors, :boolean, :default => false
      add_column :studies, :import_data_cache, :text
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Environment: WebGL, Chrome. I have the following behavior when using transparent png's as textures
Environment: Rails 3.0.4 and Ruby 1.9.2 I have the following form: <%= form_tag( {:action
I have some production Rails 2 apps. I want to start using Rails 3
ENVIRONMENT: C# I have a table of equivalent values, like this: CHEVR = CHEVROLET
environment/cucumber.rb: ... # gem dependencies config.gem 'cucumber-rails', :lib => false, :version => '>=0.3.0' unless
Environment: hudson/sonar/maven2 in ubuntu locally with default parameters And I got the log from
I have a Ruby on Rails project that has been untouched for a while,
Environment: Android 2.3.3 with Google API I know this is kind of long, but
root@app1:~# gem -v 1.8.10 I get 1.8.10 when I use rvm. But when I
Environment: I have that User entity : @Entity public class User implements Serializable {

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.