趣味の開発用にVPSでRails環境を構築した時のメモ。
rbenv + ruby-build
$ sudo yum update
$ sudo yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison git
$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
$ source ~/.bash_profile
$ rbenv -v
$ git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ rbenv install -l
$ rbenv install 2.2.2
$ rbenv global 2.2.2
$ rbenv rehash
$ rbenv versions
$ gem install rails --version="5.0.1"
$ rails -v
Nginx
$ sudo yum -y install nginx
$ sudo service nginx start
$ sudo chkconfig nginx on
$ sudo chkconfig --list nginx
tsyknsr.hatenablog.com
参考