Create on Amazon EC2
ssh -i "nykfuel-luc.pem" [email protected]
yum groupinstall "Development Tools"
yum install git pcre pcre-devel
yum install postgresql94-devel
git clone git://github.com/sstephenson/rbenv.git /home/deployer/.rbenv
nano /etc/profile.d/rbenv.sh
export RBENV_ROOT=/usr/local/rbenv
export PATH="${RBENV_ROOT}/bin:$PATH"
eval "$(rbenv init -)"
. /etc/profile
git clone https://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build
yum install -y openssl-devel readline-devel zlib-devel
rbenv install 2.2.3
Downloading ruby-2.2.3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.3.tar.bz2
Installing ruby-2.2.3...
Installed ruby-2.2.3 to /usr/local/rbenv/versions/2.2.3
rbenv global 2.2.3
rbenv rehash
gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/
gem sources -l
*** CURRENT SOURCES ***
https://ruby.taobao.org
gem update --system
gem install bundler
And...
bundle config mirror.https://rubygems.org https://ruby.taobao.org
gem install rails
yum install nodejs npm --enablerepo=epel
Need to add HTTP Connection. Inbound rule.
http tcp 80 0.0.0.0/0
RAILS_ENV=staging rake db:create
RAILS_ENV=staging rake db:migrate
RAILS_ENV=staging rake db:seed
RAILS_ENV=staging rake assets:precompile
staging:
adapter: postgresql
encoding: unicode
pool: 25
database: nykfuel
username: nykfuel
password: PPIvkMJki3xP
host: nykfuel-staging.cmketunlbvea.rds.cn-north-1.amazonaws.com.cn
template: template0
sudo su
bundle exec unicorn -p 80 --env=staging