1

我刚刚更新到 Rails 4.1,mailboxer 似乎对这个变化并不满意。以下是我尝试从控制台获取收件箱时发生的情况。

 [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

有什么突出的可修复的吗?我在开发环境中。谢谢

4

2 回答 2

4

我发现我需要运行$ rails generate mailboxer:namespacing_compatibilityrails 4.1 升级

于 2014-05-25T19:09:12.107 回答
0

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

您需要在 Gemfile 中将“mailboxer”gem 版本提及为“0.11.0”。
如果您不提及任何版本,它可以使用更高版本(当前“0.12.0”更高)并且您的页面可能会中断。

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

宝石'邮箱','0.11.0'

谢谢。

于 2014-06-06T15:35:04.350 回答