PG ::错误:错误:关系“mailboxer_notifications”不存在

时间:2014-05-24 21:44:28

标签: ruby-on-rails mailboxer ruby-on-rails-4.1

我刚刚更新到rails 4.1并且邮箱似乎对此更改感到高兴。下面是当我尝试从我的控制台获取收件箱时发生的情况。

 [18] snifme »  Master.last.mailbox.inbox
  Master Load (0.6ms)  SELECT  "masters".* FROM "masters"   ORDER BY "masters"."id" DESC LIMIT 1
PG::Error: ERROR:  relation "mailboxer_notifications" does not exist
LINE 5:                WHERE a.attrelid = '"mailboxer_notifications"...
                                          ^
:               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 = '"mailboxer_notifications"'::regclass
                 AND a.attnum > 0 AND NOT a.attisdropped
               ORDER BY a.attnum

(pry) output error: #<ActiveRecord::StatementInvalid: PG::Error: ERROR:  relation "mailboxer_notifications" does not exist
LINE 5:                WHERE a.attrelid = '"mailboxer_notifications"...
                                          ^
:               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 = '"mailboxer_notifications"'::regclass
                 AND a.attnum > 0 AND NOT a.attisdropped
               ORDER BY a.attnum

有什么突出的东西可以解决吗?我在开发环境中。感谢

2 个答案:

答案 0 :(得分:4)

我发现我需要为rails 4.1 upgrade

运行$ rails generate mailboxer:namespacing_compatibility

答案 1 :(得分:0)

我也遇到了同样的问题,上面的命令对我不起作用。

你需要在Gemfile中提到'mailboxer'宝石版本为'0.11.0'。
如果你没有提到任何版本它可以使用更高版本(目前'0.12.0'更高)和你的页面可以破解。

它主要发生在生产环境(heroku等)上。

  

gem'boxerer','0.11.0'

感谢。