PGError: ERROR: relation "instructions" does not exist

HI,

I got this error when i am testing my rails application. I dont have the table named ‘instructions’. But it shows a error like “ERROR: relation “instructions” does not exist”. Totally, I got same error for 64 tests as 64 errors.

I am using rails 3.0, Ruby 1.9.2, Netbeans 6.8.

PS: I didnt creat Instruction manual for rails application.

** Error:
test_should_get_index(HomeControllerTest):
ActiveRecord::StatementInvalid: PGError: ERROR: relation “instructions” does not exist
LINE 1: DELETE FROM “instructions”
^
: DELETE FROM “instructions”**

Kindly help me in this regard

Hi,

It doesnt show problem for other tables through schema. It shows problem for “instructions” which created default by rails 3. “Instructions is not a table which come under schema of psql database”- So, i am thinking
that this maynot be a migration issues or preparatory issue to psql. But, execution considers “instructions” as a table in psql. I understood
in this aspect and i cant trace the error between the misunderstand of “instructions” as table in psql database.

Show us the full stack trace and the code of yours that it points to.

First though do a global search for the string 'instructions' in your
code. I suspect you may find that you have a typo or missing comment
indicator that is causing the problem.

Colin

Hi,
It doesnt show problem for other tables through schema. It shows problem for
"instructions" which created default by rails 3. "Instructions is not a
table which come under schema of psql database"

I don't understand what you are saying here, are you saying Rails
created an instructions table by default? Also what do you mean by
the sentence in " "

Colin

Hi,

I'm not sure if I had your same issue, but I had a similar error
message when the table's name changes dynamically. In order to fixed I
used a real SQL statement directly and it worked, I didn't waste time
trying to figure what was the problem, I fear. For example:
TableClass.find_by_sql("SELECT * FROM tablename") instead of
TableClass.find(:all).

Hope help,
Exequiel.