Skip to content

Instantly share code, notes, and snippets.

@madogiwa0124
Last active February 25, 2018 14:05
Show Gist options
  • Save madogiwa0124/411cbd242abdf60b97a35b6ec86e4e9f to your computer and use it in GitHub Desktop.
Save madogiwa0124/411cbd242abdf60b97a35b6ec86e4e9f to your computer and use it in GitHub Desktop.
Ruby開発環境のVagrantFile(未完成)
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 3000, host: 3000
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
end
# config.vm.synced_folder "./workspace", "~/workspace", :create => true
config.vm.provision "shell", privileged: false, inline: <<-SHELL
# apt-getを更新
sudo apt-get -y upgrade
sudo apt-get -y update
# 周辺ライブラリをインストール
sudo apt-get install git curl g++ make vim nodejs libreadline-dev libssl-dev zlib1g-dev imagemagick libmagickcore-dev libmagickwand-dev -y
# 初期インストールされているrubyを削除
sudo apt-get remove ruby -y
# rbenv、ruby-buildのインストール
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
# rubyをインストール
# バージョンは自分のローカルと同じものにしてください。
rbenv install 2.4.3
rbenv global 2.4.3
rbenv rehash
# bundleをインストール
gem install bundler
# postgresqlをインストール
sudo apt-get install postgresql postgresql-contrib python-psycopg2 libpq-dev -y
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment