VagrantでRails環境を構築

VagrantRails環境を構築した時のメモ。

$ vagrant ssh
$ sudo yum update
$ sudo yum -y install 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
$ mkdir -p "$(rbenv root)"/plugins
$ git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
$ rbenv install --list
$ sudo yum install gcc make openssl-devel libffi-devel readline-devel
$ rbenv install 2.3.0
$ rbenv global 2.3.0
$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
$ sudo yum install http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
$ sudo yum install mysql mysql-devel mysql-server mysql-utilities
$ sudo chkconfig mysqld on
$ sudo service mysqld start
$ sudo yum -y install ImageMagick ImageMagick-devel
$ gem install bundler -N
$ sudo yum install libxml2-devel libxslt-devel
$ gem install nokogiri -v '{version}' -- --use-system-libraries=true --with-xml2-include=/usr/include/libxml2/
$ curl --silent --location https://rpm.nodesource.com/setup | bash -
$ yum -y install nodejs
$ sudo yum -y install epel-release
$ sudo yum -y install redis

参考