Question

I need to host a test app on heroku. That uses SoX to split a file and store the split files(only temporarily).

Would using rubys Dir.mktmpdir work in this situation ?

Or would I have to use #{RAILS_ROOT}/tmp/myfile_#{Process.pid} ?

And would this work with SoX ?

any help is really appreciated

Was it helpful?

Solution

Heroku has read-only file system or to be more accurate, ephemeral writeable filesystem. That means that you can do very little to actual instance while running. To read more about limitations go to Heroku docs.

I think you have 2 options...

  • Hire another VPS or EC2 somewhere and do SoX manipulation there. Before and after manipulation store files in S3 or something alike. So that you do manipulation on other servers but still host you app on Heroku.
  • Try to build your own Heroku instance with custom buildpuck and mount S3 as remote drive there. Then you might write to instance; but still a bad idea since you are probably doing some intense IO stuff.

Also have in mind, Heroku also has 3rd party addons and one of them is Zencoder, witch provides transcoding for various formats, you might also look into that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top