Top Ad unit 728 × 90

How to install Heroku on Centos 6?



These days I am working on a project where I have to use a VPS with a CentOS 6. As you may know, that is not the most updated version but to add more difficulties, it is a 32-bit machine, so there are a lot of programs which don’t work fine.

For example, if you want to use a MongoDB database, it is hardly recommended to use a 64-bits machine or you won’t be able to create databases with more than 2Gb of data.

Well, installing the Heroku toolbelt you will find some problems, so I have made this brief post to talk about it and how to fix them, so maybe someone won’t need to investigate as I had.

Before installing Heroku, you will need to install Ruby, other big problem with my machine, so after a lot of tries, I got a working solution.

First, install Development Tools:
yum groupinstall “Development tools”

Now install RVM:
curl –L get.rvm.io | bash –s stable

If you get an error about a missing public key (yes, I got that error), run this command and then run again the last command:
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

Add RVM to system path:
source /etc/profile.d/rvm.sh

Reload RVM:
rvm reload

And install ruby:
rvm install 2.1.0

Now, we have Ruby so go to the folder of your project (you want to use Heroku tools in a project, don’t you?) and do the following commands:
wget –qO- https://toolbelt.heroku.com/install.sh | sh

You will get a message like this:
“Add the Heroku CLI to your PATH using:
$ echo 'PATH="/usr/local/heroku/bin:$PATH"' >> ~/.profile
Installation complete”

Be ware, in CentOS 6 is not .profile, it is .bash_profile, so do the following command:
echo ‘PATH=”/usr/local/heroku/bin:$PATH”’ >> ~/.bash_profile

Now type this:
whereis heroku

You will get a path, you will use it in the next command:
echo ‘pathmunge <the path that you have just got>’ > /etc/profile.d/ree.sh

Open permissions to allow execute:
chmod +x /etc/profile.d/ree.sh

Now log out and log back in. Heroku should be installed and working, but before checking the following commands:
whereis heroku

You should get something like this:
“heroku: /usr/local/heroku”

And now try this:
which heroku

Where you should get this:
“/usr/local/heroku/bin/heroku”

Then, you have installed Heroku, now you can start working with it, for example, type:
heroku login

And this is all for now, if you had any problem or any question, feel free to ask here or on my Twitter account: https://twitter.com/nautadev. Regards!
How to install Heroku on Centos 6? Reviewed by A Work Online on 6:36:00 PM Rating: 5

2 comments:

All Rights Reserved by Ondade © 2017

Contact Form

Name

Email *

Message *

Powered by Blogger.