Thursday, October 16, 2014

Setup VPS for Ruby On Rails on Ubuntu 12.04 LTS

In this case, i'm using RVM for installing ROR

1. Update the Ubuntu

sudo apt-get update
sudo apt-get upgrade
after done, you need to restart the server for clean.
sudo shutdown -r now

2. Install MySQL

sudo apt-get install mysql-server mysql-client libapache2-mod-auth-mysql php5-mysql
Need, install the PHP for using phpmyadmin
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

3. Install dependencies

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 ncurses-dev automake libtool bison subversion libpq-dev

4. Install Curl

sudo apt-get install curl

5. Install RVM

\curl -L https://get.rvm.io | bash -s stable --ruby
source ~/.rvm/scripts/rvm
After installed RVM, close your terminal and login back to use the "rvm" command: RVM has some dependencies to need install, run this command.
rvm requirements
and if any install some recommended dependencies

6. Install Ruby

rvm list known
Will display like this:
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p547]
[ruby-]2.0.0-p481
[ruby-]2.0.0[-p576]
[ruby-]2.1.2
[ruby-]2.1[.3]
[ruby-]2.1-head
ruby-head
rvm install 2.1.2
rvm use 2.1.2 --default
check the version installed Ruby and Gem
ruby -v
gem -v

7. Install Rails

gem install rails

8. Install MySQL gem

Firstly, need install mysql dev
sudo apt-get install libmysqlclient-dev
gem install mysql2

9. Install ImageMagic

sudo apt-get install imagemagick

10. Install Javascript Runtime

sudo apt-get install nodejs

11. Install Phusion Passenger

gem install passenger
View script apache installation run this script:
passenger-install-apache2-module

No comments:

Post a Comment