Computersnyou

Installing Ruby On Rail On Ubuntu with Rbenv

Posted on  3/7/2013

In This tutorial i will show you how to install

  1. rbenve – ruby version manager
  2.  ruby binary
  3.  ruby-on-rails – framework 

1 : Installing rbenv 

Setup : 

$ sudo apt-get update
$ sudo apt-get upgrade -y

Install Required Components For Ruby and other dependencies  

$ sudo apt-get install git-core -y
$ sudo apt-get install curl -y

$ sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev

Clone rbenv

Clone rbenv
Clone rbenv
$ git clone git://github.com/sstephenson/rbenv.git ~/.rbenv

$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile

$ echo 'eval "$(rbenv init -)"' >> ~/.profile

 

Screenshot from 2013-03-07 10:31:34
Screenshot from 2013-03-07 10:31:34

 

( Note modify .bash_profile , .bash_login or .zshrc according to your need )

now install some required rbenv plugins

$ cd  ~/.rbenv/
$ mkdir plugins
$ cd  ~/.rbenv/plugins

$ git clone git://github.com/sstephenson/ruby-build.git

Restart Terminal

 

2 : Let’s Install Ruby

$ rbenv  install 1.9.3-p385
Screenshot from 2013-03-07 10:46:12
Screenshot from 2013-03-07 10:46:12

Set Your Global Ruby version

$ rbenv global 1.9.3-p385
$ rbenv rehash
$ ruby -v
ruby -v
ruby -v

3 : Install Ruby-On-Rails Framework 

$ gem install bundler
$ gem install rails

( dont panic installing rails will take some time )

 

rails -v
rails -v

 

rails new blog
rails new blog
rails new blog


  • Home
  • About