Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下情况:
我希望能够将独立的 Ruby 脚本作为守护进程运行。我希望能够在我的 Rails 项目的上下文/环境中执行此脚本(例如,以便脚本可以访问后端/我的 Rails 模型)。
有没有一种简单的方法可以做到这一点?
谢谢!
使用rails runner。
您还可以创建一个 rake 任务。