読者です 読者をやめる 読者になる 読者になる

Rails環境の構築

Ruby on Rails

趣味の開発用にVPSRails環境を構築した時のメモ。

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

Rails

$ 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

Basic認証

tsyknsr.hatenablog.com

参考