Skip to content

Instantly share code, notes, and snippets.

@chandresh
Last active December 22, 2015 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chandresh/6458958 to your computer and use it in GitHub Desktop.
Save chandresh/6458958 to your computer and use it in GitHub Desktop.
Installing Ruby using Rbenv on Ubuntu

Step 0 : Pre-requisites

sudo apt-get -y update
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
sudo apt-get -y install git-core
sudo apt-get -y install nodejs
sudo apt-get -y install sqlite3 libsqlite3-dev

On Lucid, try this for nodejs:

sudo apt-get install -y python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

If NodeJs install does not work try:

http://www.codediesel.com/linux/installing-node-js-on-ubuntu-10-04/

Step 1 : Rbenv

git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> .bashrc
echo 'eval "$(rbenv init -)"' >> .bashrc
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
source ~/.bashrc

Step 2 : Installing Ruby

rbenv install 2.1.0
rbenv rehash
rbenv global 2.1.0

ruby -v

Step 3: Install Rails:

gem install rails
   

Step 4: Change the Vagrantfile (If you are using Vagrant)

config.vm.network :forwarded_port, guest: 3000, host: 3000
@chandresh
Copy link
Author

sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev

sudo apt-get install mysql-server mysql-client libmysqlclient-dev

sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-common
sudo apt-get install postgresql-9.3 libpq-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment