13 July 2015

Install Ruby on Debian

https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-debian-7-wheezy

sudo apt-get update
sudo apt-get install git-core
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
type rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash

sudo apt-get install build-essential libssl-dev libcurl4-openssl-dev libreadline-dev -y
rbenv install --list
rbenv install 2.1.5 -k 
rbenv global 2.1.5
ruby -v

Installing Rails

sudo apt-get install sqlite3 libsqlite3-dev

Edit the file sources.list

sudo nano /etc/apt/sources.list

Append

deb http://ftp.us.debian.org/debian/ wheezy-backports main
deb-src http://ftp.us.debian.org/debian/ wheezy-backports main
sudo apt-get update
sudo apt-get -t wheezy-backports install nodejs
gem install rails

Ready to create Rails apps.

Updating

https://github.com/sstephenson/rbenv#basic-github-checkout rbenv rehash

Installs shims for all Ruby executables known to rbenv (i.e., ~/.rbenv/versions/*/bin/*).
Run this command after you install a new version of Ruby, or install a gem that provides commands.

$ rbenv rehash