GitHub Actions 失败:“检查 SKIP_DB_AND_REDIS 启动性”步骤

不,仍然成功。

为了验证插件代码是否已加载,我使用了 “puts DiscourseKofi::Engine.to_s”,它打印出了名称。但当我引用会创建数据库连接的类 “puts DiscourseKofi::Admin::AccountsController.to_s” 时,最终失败了。

看来它并没有像 GitHub Action 中那样在本地完全加载插件代码。

完整的失败命令如下:

LOAD_PLUGINS=1 SKIP_DB_AND_REDIS=1 DISCOURSE_DEV_DB=nonexistent bin/rails runner "puts DiscourseKofi::Admin::AccountsController.to_s"

如果不使用 LOAD_PLUGINS=1 或使用 RAILS_DB=nonexistent,则不会导致失败。