【发布时间】:2023-04-04 16:46:01
【问题描述】:
简单的问题。如何在测试环境中使用 Foreman 启动 Rails?
RAILS_ENV=test bundle exec foreman start
// 在开发中开始
bundle exec foreman -e test start
// 炸弹
bundle exec foreman start -e test
// 炸弹
【问题讨论】:
标签: ruby-on-rails foreman
简单的问题。如何在测试环境中使用 Foreman 启动 Rails?
RAILS_ENV=test bundle exec foreman start
// 在开发中开始
bundle exec foreman -e test start
// 炸弹
bundle exec foreman start -e test
// 炸弹
【问题讨论】:
标签: ruby-on-rails foreman
Foreman 必须指向一个 Procfile,或者 Procfile 必须存在于当前目录中。
# Procfile
rails s
然后你会跑
foreman start -f Procfile
通常的做法是保留 Procfile.test、Procfile.dev 等。
# Procfile.test
rails s -e test
希望有帮助:)
【讨论】: