Skip to content

Instantly share code, notes, and snippets.

@vysakh0
Last active December 30, 2015 06:19
Show Gist options
  • Save vysakh0/7788490 to your computer and use it in GitHub Desktop.
Save vysakh0/7788490 to your computer and use it in GitHub Desktop.
Configuring Ubuntu VPS for Rails app

Basic Packages

sudo apt-get update
sudo apt-get install git-core python-software-properties software-properties-common

Install nginx

sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install nginx

Installing postgresql

sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql libpq-dev
sudo su - postgres
psql
> CREATE USER celeb WITH PASSWORD 'unicorn';
> CREATE DATABASE celeb;
> GRANT ALL PRIVILEGES ON DATABASE stagingcel to celeb

Install nodejs

sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

Install a redis-server

sudo apt-add-repository ppa:chris-lea/redis-server
sudo apt-get update
sudo apt-get install redis-server

install rbenv

curl https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
echo 'eval "$(rbenv init -)"' >> ~/.profile
source ~/.profile

Basic packages for Ruby

sudo apt-get install libreadline-dev libssl-dev zlib1g-dev build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
rbenv bootstrap-ubuntu-12-04

Install Ruby

CONFIGURE_OPTS="--with-readline-dir=/usr/include/readline" rbenv install 2.1.1 
rbenv global 2.1.1

Install bundler

gem install bundler --no-ri --no-rdoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment