How to export a Ruby Array from my Heroku console into CSV?
csv, heroku, ruby, ruby-on-rails
Solution
You can't access your local filesystem from the heroku console. One option is to use Tee. Tee sends the output to both STDOUT and a file, so you can have a local log of everything that was printed.
heroku run console | tee output.txt
Problem
I am looking to export an array from my heroku console into a local CSV file. In my current situation, I have a daily rake task which looks for tweets talking about my application. I'd like to analyse those tweets to see at what time they came in, etc: ``` heroku run console tweets = Tweet.all code to export tweets into a local CSV file goes here ``` Any ideas would be greatly appreciated!