Tuesday, May 15, 2012

Install Pip + Heroku + Foreman in Ubuntu 12.04

UPDATE:
Heroku has released their own toolkit, so this steps may no longer be required.
https://toolbelt.heroku.com/


Installing rails

You need to have ruby installed on your system
To install ruby, type in:

sudo apt-get install ruby

You can install rails either through gem or apt-get. I installed it using apt-get. You can do that by typing

sudo apt-get install rails

Installing heroku:

For heroku you need to have gem installed, to install gem, using apt-get type:

sudo apt-get install rubygems1.8

Also, before installing heroku you need to install rubydev as directly installing heroku gave me problems. To install rubydev type:

sudo apt-get install ruby1.8-dev

To add the .gem directory to your path type in:

gedit ~/.bashrc

At the end of the file type in:

sudo apt-get install python-pip
sudo apt-get install libpq-dev python-dev


PATH=$PATH:/home/_username_/.gem/ruby/1.8/bin
export PATH
(Replace _username_ with your username)

Now type in

source ~/.bashrc

This will add gem to your path. Now install heroku

now install heroku by typing:

sudo gem install heroku

And you are done! Heroku is installed. You may want to install additional tools needed by heroku, documented as following.

sudo gem install foreman

Install virtualenv
sudo apt-get install python-virtualenv

You can also install django in env in order to deploy django to Heroku see this tutorial for further instructions
pip install Django psycopg2

2 comments:

  1. Nice post! I followed it and got Heroku set up done on my machine in no time :)

    ReplyDelete
    Replies
    1. its a pleasure, this is a bit outdated though because they heroku now has a toolkit but i am glad it worked for you.

      Delete