6

I'm trying to upload file to amazon s3 and apparently I have to write to a temp file first then upload that file. But I cannot figure it out how to do that with Sinatra and heroku since it cannot find "#{RAILS_ROOT}" or #{Rail.root} how do I upload temp file to sinatra with heroku.

Thanks

1 Answer 1

11

I'm assuming you have read through Heroku's docs for Uploading to S3. The temp directory path on Heroku is ./tmp. If you are running Sinatra, Heroku likely does not create the environment variables related to Rails (although it may, I'm not sure). Here is more info on Heroku's file system.

EDIT: In Sinatra, you can get the root directory via settings.root, similar to RAILS_ROOT.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.