Implantando aplicativo Rails em um VPS

Atualizando pacotes

sudo apt-get update

Instalando RVM

curl -L get.rvm.io | bash -s stable
source
~/.rvm/scripts/rvm

Instalando dependências

rvm requirements

Instalando Ruby

rvm install 2.x.x
rvm
use 2.x.x --default

Instalando joias

echo "gem: --no-ri --no-rdoc" > ~/.gemrc
rvm rubygems current

gem install rails

gem install passenger

Instalando Nginx / Passenger

apt-get install libcurl4-openssl-dev
rvmsudo passenger
-install-nginx-module
sudo service nginx start

Se tem erros

wget -O init-deb.sh https://www.linode.com/docs/assets/660-init-deb.sh
sudo mv init
-deb.sh /etc/init.d/nginx
sudo chmod
+x /etc/init.d/nginx
sudo
/usr/sbin/update-rc.d -f nginx defaults

Configurando o Nginx VH

sudo nano /opt/nginx/conf/nginx.conf

server
{
listen
80;
server_name localhost
;
passenger_enabled on
;
rails_env production
;
root
/home/user/app/public;
}

Instalando o NodeJS:

sudo apt-get install nodejs
sudo apt
-get install npm
ln
-s /usr/bin/nodejs /usr/bin/node