我想在 Heroku 上的应用程序上运行一个 rake 脚本,这需要几个小时。如果我从笔记本电脑的控制台启动它,然后关闭笔记本电脑,脚本将停止(并且我必须在脚本完成之前关闭笔记本电脑)。
如何在不“绑定(bind)”到我的笔记本电脑的情况下启动这个 rake 脚本。 IE。让它继续运行直到它中断或完成?
heroku run rake update_feeds_complete --app myapp
是要运行的脚本...
向我提供有关 Google 哪些命令等方面的建议也会有所帮助。
最佳答案
您可以使用 run:detached
运行命令并关闭终端窗口,它们将继续运行。所以你只需要运行
heroku run:detached rake update_feeds_complete --app myapp
关于ruby-on-rails - rails : start script on server and then "leave",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10586607/