运行插件规格时出错

在尝试运行最新版本的插件规约时,我在两个开发实例上遇到了此问题。

(数据库已在测试环境中完全迁移):
例如 bin/rake plugin:spec\[discourse-locations]

加载 rails_helper 时出错。
Failure/Error: default_scope { where(deleted_at: nil) }

ActiveRecord::StatementInvalid:
  PG::UndefinedTable: ERROR:  relation "chat_channels" does not exist
  LINE 9:  WHERE a.attrelid = '"chat_channels"'::regclass

< SNIP >

# --- Caused by: ---
# PG::UndefinedTable:
#   ERROR:  relation "chat_channels" does not exist
#   LINE 9:  WHERE a.attrelid = '"chat_channels"'::regclass

查看测试数据库,聊天迁移似乎没有运行。

> psql discourse_test

# \d

哦……!

我忘了添加第一个环境变量以在数据库迁移中包含插件(因为聊天仍然是一个插件):

LOAD_PLUGINS=1 RAILS_ENV=test rake db:migrate
3 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.