I have a Python script in the /app/bin directory of my Rails app that contains a requirements.txt file that includes all of the dependencies it relies on.
How do I get it to run on the same Heroku instance that my Rails app currently runs on (my Rails app call the python script occasionally).
Here’s what I’ve tried so far:
- Put the
requirements.txtfile in the/dir. Didn’t install any python dependencies - Tried running
heroku run bashand then runningpip install -r requirements.txt. Got the messagepip command not found. - Tried installing pip through the bash interface using
sudo python get-pip.pyaftercurling the script as suggested on the pip installation site. Didn’t work — not surprisingly, they don’t supportsudocommands on the instance.
I know Heroku is supposed to support pip out of the box, but it doesn’t seem to do anything with the requirements.txt file once it’s detected a Ruby app.
Advertisement
Answer
You can use the Heroku Buildpack Multi to run both the python and the ruby application on the same instance using their respective buildpacks.