Skip to content Skip to sidebar Skip to footer

How To Install Python Module On Heroku Cedar Stack With Rails

We have a rails app running on the Heroku Cedar stack, and we have a need for an external python module, namely 'pyPdf'. Unfortunately it is not one of the pre-installed python mod

Solution 1:

Is this module something that you're trying to access from your Rails application? If so, you can always access bash on a dyno to download and compile a library (if compilation is needed) and then stuff the resultant file into your application codebase (somewhere like /app/bin). Then you can refer to this binary in your code.

To access bash on a dyno:

heroku run bash --app your_app_name

An example of the above:

http://theprogrammingbutler.com/blog/archives/2011/07/28/running-pdftotext-on-heroku/

Note, you won't be able to install anything into a dyno because the dynos change on an ad-hoc basis and you'll never know what state your in. Also note that the moment you exit from bash that dyno is killed, so don't leave anything laying around - it'll get vaporised.

Post a Comment for "How To Install Python Module On Heroku Cedar Stack With Rails"