user984621
user984621

Reputation: 48453

How to run simple ruby script (not RoR app) on heroku?

I wonder about how can I run simple script on Heroku? Until now I have been working only with RoR app which I hosted on Heroku, but I never run there one simple script.

I would need just run simple ruby script which would be run by Scheduler. How could I do that?

Upvotes: 3

Views: 1042

Answers (2)

kansiho
kansiho

Reputation: 532

All you have to do is just add blank Gemfile and Gemfile.lock so that heroku detects your app as a Ruby app.

#!/usr/bin/env ruby
source 'https://rubygems.org'

Upvotes: 0

MurifoX
MurifoX

Reputation: 15089

Use rake and the scheduler addon from Heroku.
Here is a comprehensive guide in the heroku docs.
https://devcenter.heroku.com/articles/scheduler
Baiscally you create a rake task and select when to run it. It is quite simple.

Upvotes: 1

Related Questions