Skip to content

Instantly share code, notes, and snippets.

@foxweb
Created February 9, 2017 20:06
Show Gist options
  • Save foxweb/ed2ad1b14804d5baf557327eb1cfdb3d to your computer and use it in GitHub Desktop.
Save foxweb/ed2ad1b14804d5baf557327eb1cfdb3d to your computer and use it in GitHub Desktop.
rake aborted!
ActiveAdmin::DatabaseHitDuringLoad: Your file, app/models/subscription_type.rb (line 22), caused a database error while Active Admin was loading. This is most common when your database is missing or doesn't have the latest migrations applied. To prevent this error, move the code to a place where it will only be run when a page is rendered. One solution can be, to wrap the query in a Proc.Original error message: PG::UndefinedTable: ERROR: relation "subscription_types" does not exist
LINE 5: WHERE a.attrelid = '"subscription_types"'::re...
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"subscription_types"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
/Users/foxweb/work/qlean/config/routes.rb:98:in `block in <top (required)>'
/Users/foxweb/work/qlean/config/routes.rb:3:in `<top (required)>'
/Users/foxweb/work/qlean/config/environment.rb:5:in `<top (required)>'
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "subscription_types" does not exist
LINE 5: WHERE a.attrelid = '"subscription_types"'::re...
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"subscription_types"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
/Users/foxweb/work/qlean/app/models/subscription_type.rb:22:in `<class:SubscriptionType>'
/Users/foxweb/work/qlean/app/models/subscription_type.rb:10:in `<top (required)>'
/Users/foxweb/work/qlean/app/admin/subscription_type.rb:3:in `<top (required)>'
/Users/foxweb/work/qlean/config/routes.rb:98:in `block in <top (required)>'
/Users/foxweb/work/qlean/config/routes.rb:3:in `<top (required)>'
/Users/foxweb/work/qlean/config/environment.rb:5:in `<top (required)>'
PG::UndefinedTable: ERROR: relation "subscription_types" does not exist
LINE 5: WHERE a.attrelid = '"subscription_types"'::re...
^
/Users/foxweb/work/qlean/app/models/subscription_type.rb:22:in `<class:SubscriptionType>'
/Users/foxweb/work/qlean/app/models/subscription_type.rb:10:in `<top (required)>'
/Users/foxweb/work/qlean/app/admin/subscription_type.rb:3:in `<top (required)>'
/Users/foxweb/work/qlean/config/routes.rb:98:in `block in <top (required)>'
/Users/foxweb/work/qlean/config/routes.rb:3:in `<top (required)>'
/Users/foxweb/work/qlean/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => db:reset => environment
(See full trace by running task with --trace)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment