Menu
abriraqui
  • reflexiones
  • publicaciones
  • hackership
  • experiencias
abriraqui

Tips. Solving ” PG::Error: ERROR: relation “tags” does not exist”

Posted on January 17, 2013January 17, 2013

Tweet

After doing a merge between branches I got an error, that I was not sure why was there.
The error was on the acts_as_taggable_on fields

Failures:

1) GET /cycles display cycles
Failure/Error: visit cycles_path
ActionView::Template::Error:
PG::Error: ERROR: relation "tags" does not exist
LINE 4: WHERE a.attrelid = '"tags"'::regclass
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"tags"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum

I tried different things that didn’t work until I thought about reseting the database

$ rake db:reset RAILS_ENV=test

Once I did it, everything worked again 🙂

1 thought on “Tips. Solving ” PG::Error: ERROR: relation “tags” does not exist””

  1. kwestionmark says:
    April 13, 2015 at 3:21 pm

    Had a similar issue with Heroku, the issue was reproduced locally on my local production environment

    $ rake db:reset RAILS_ENV=production worked for me

Comments are closed.

©2023 abriraqui | Powered by SuperbThemes & WordPress