how to run a simple file on heroku

后端 未结 5 2046
庸人自扰
庸人自扰 2021-02-05 13:46

say I\'ve got my rails app on github and am deploying the github repo on heroku.

I\'ve got a situation where I have a simple text file with bunch of words (it is in my g

5条回答
  •  自闭症患者
    2021-02-05 13:59

    Since you're talking about a Rails app on Heroku, how about using rails runner:

    heroku run bundle exec rails runner ./path/to/script.rb -a 
    

    Have a look at the RailsGuides for rails runner for more details.


    Alternatively, turn that script into a rake task if runner is not your cup of tea (eg, for recurring tasks).

提交回复
热议问题