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!
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
I tried using Tee as suggested and also got stuck at
Running `console` attached to terminal... up, run.4165
I ended up running an SSH shell to localhost and then piped it through tee.
$ ssh localhost | tee output.txt $ heroku run console
Might not be the best solution, but it worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With