learn_plsql
learn_plsql

Reputation: 1681

reading a file in rails app deployed on heroku

I have a rails app deployed in heroku. In the app I have a simple txt file. I have a ruby script that loops on all records in this file, makes a URL out of it and then does other stuff with it.

I can not do this locally and then transfer the data to my heroku app.

From heroku console is it possible to run a traditional simple ruby script that would loop over a simple txt file in my heroku app?

Upvotes: 1

Views: 3088

Answers (1)

house9
house9

Reputation: 20614

yes you can read a text file, as long as it is pushed to Heroku with your code, the syntax is the same as reading files on your localhost

s = File.read("#{Rails.root}/app/assets/some_text_file.txt")

Heroku does not allow writing files

Upvotes: 5

Related Questions