简体   繁体   中英

How to run Clockwork in Heroku

I'm really new to Heroku, but I have a problem. I have created a Clockwork script called "clock.rb" in rails and I use:

bundle exec clockwork clock.rb

to run it in the background on my local server, but How I can run that on Heroku server? (I would like the cheapest solution)

Thanks!!!

To your Procfile use like this

worker: bundle exec clockwork clock.rb

it will start the server every time after Heroku push/web server restart.

Or you can run using console from your computer like this but in this case, you need to run every time after web server restarting

heroku run bundle exec clockwork clock.rb

and from Heroku open console and type

bundle exec clockwork clock.rb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM