How do you create a Sinatra app that can generate ebooks on Heroku?

Hi guys,

I want to create a Sinatra app that can generate epub, pdf and mobi in
Heroku. I have a good idea on the pdf part, but I have no idea how to
make it work with Heroku.

I also don’t know which epub and mobi gems can be used in Heroku.

Can you guys help?

Thanks
Kenley

On May 7, 2012, at 4:00 PM, Kenley T. wrote:

Thanks
Kenley

Hi Kenley,

the heroku mailing list would be a better place for a question like this
:).

Heroku has a tmp filesystem, so you can write files to /tmp. It is
guaranteed
to stay there for the length of the request, so you can generate a pdf
and
serve it. Things get problematic if you want to generate the pdf and
keep it
around for later use. Then you have 2 options:

  • Work probabilistically: regenerate the file each time it is not found
    on
    the filesystem (messy…)
  • Store it somewhere else after generation: S3 is a common option to do
    this
    and its quite cheap for low volumes.

Regards,
Florian