Last active
February 21, 2018 03:50
-
-
Save kou029w/4c6005fda2525ec189b3505369259def to your computer and use it in GitHub Desktop.
rails on centos, vagrant
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure('2') do |config| | |
config.vm.box = 'centos/7' | |
config.vm.network 'forwarded_port', guest: 3000, host: 3000 | |
config.vm.provision 'shell', privileged: false, inline: <<~'SCRIPT' | |
# anyenv のインストール | |
sudo yum install -y git | |
git clone https://github.com/riywo/anyenv ~/.anyenv | |
echo 'export PATH="$HOME/.anyenv/bin:$PATH"' >> ~/.bash_profile | |
echo 'eval "$(anyenv init -)"' >> ~/.bash_profile | |
SCRIPT | |
config.vm.provision 'shell', privileged: false, inline: <<~'SCRIPT' | |
# rbenv のインストール | |
anyenv install rbenv | |
# ndenv のインストール | |
anyenv install ndenv | |
SCRIPT | |
config.vm.provision 'shell', privileged: false, inline: <<~'SCRIPT' | |
# Ruby 2.5.0 のインストール | |
sudo yum install -y gcc openssl-devel readline-devel | |
rbenv install 2.5.0 | |
rbenv global 2.5.0 | |
# Node.js 8.9.4 のインストール | |
ndenv install 8.9.4 | |
ndenv rehash | |
# Rails 5.1 のインストール | |
sudo yum install -y libffi-devel sqlite sqlite-devel | |
gem install rails -v "~> 5.1.0" | |
# サンプル | |
rails new sample-app | |
cd sample-app | |
bin/bundle ins --path vendor/bundle | |
SCRIPT | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment