Skip to content

Instantly share code, notes, and snippets.

@chiepomme
Created February 25, 2015 06:29
Show Gist options
  • Save chiepomme/e3d025f9ab0a01f48bec to your computer and use it in GitHub Desktop.
Save chiepomme/e3d025f9ab0a01f48bec to your computer and use it in GitHub Desktop.
Windows でファイル共有して動く ruby(rbenv) + mysql な Vagrantfile
/*
!/Vagrantfile
!/.gitignore
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 80, host: 80
config.vm.synced_folder "../", "/home/vagrant/chiepomme"
config.vm.provision "shell", run: "once", privileged: true, inline: <<-SHELL
apt-get update
apt-get install -y git
apt-get install -y libffi-dev zlib1g-dev libssl-dev libmysqld-dev libreadline-dev ruby-dev
echo "mysql-server mysql-server/root_password password TEMPORAL_PASSWORD" | debconf-set-selections
echo "mysql-server mysql-server/root_password_again password TEMPORAL_PASSWORD" | debconf-set-selections
apt-get install -y mysql-server
mysql -uroot -pTEMPORAL_PASSWORD -e "SET PASSWORD = PASSWORD('');"
SHELL
config.vm.provision "shell", run: "once", privileged: false, inline: <<-SHELL
git clone https://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"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
rbenv install 2.2.0
rbenv rehash
rbenv global 2.2.0
rbenv rehash
gem install bundler rails
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment