sábado, 9 de junio de 2012

Install m2crypt in heroku

If you ever had the need to install m2crypt in a heroku app, but you keep getting
       unable to execute swig: No such file or directory
      
       error: command 'swig' failed with exit status 1
when doing a normal push with your requirements.txt on place.
I got a solution for you, you just need to use a thing heroku calls buildpacks, these are bash scripts that heroku uses to setup your application, dependencies and all.
So you need a custom buildpack that preinstalls m2crypto for you.

For an existing heroku app
heroku config:add BUILDPACK_URL=https://github.com/guybowden/heroku-buildpack-python-paybox.git

If you want to create an app with m2crypto builtin just do
 heroku create myapp --buildpack https://github.com/guybowden/heroku-buildpack-python-paybox.git

And thats it, heroku will use this custom buildpack with the necessary code to install m2crypt.
Cheers!

No hay comentarios:

Publicar un comentario