Wasswa Samuel
Wasswa Samuel

Reputation: 2179

Retrieving a CSV file in lib/assets directory in Rails 3.2 on Heroku

I deployed Harry's prelaunchr microsite whose code can be found here https://github.com/harrystech/prelaunchr on Heroku and it says I have to run this rake task bundle exec rake prelaunchr:create_winner_csvs and the app will export the CSVs in the \lib\assets folder. I run the task on Heroku but I have no idea how to get the CSVs from heroku. Any idea?

Upvotes: 0

Views: 484

Answers (1)

rovermicrover
rovermicrover

Reputation: 1453

In order for this to work on heroku you are going to need to output the file to an external source from the rake task, due to the reasons state above in the comments. You can do this using the fog gem. While I am unsure of your requires the basic idea would be once the file is being done written to use the fog gem to do a direct upload to an S3 bucket and then save the results of this upload to your database, or output them in a way that you will be able to safely access them. The gem can be found here.

https://github.com/fog/fog

Upvotes: 1

Related Questions