Last active
August 29, 2015 14:05
-
-
Save zchee/29fd07909478497d5ac3 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
RBENV_INSTALL_DEST_DIR=/usr/local/rbenv | |
COMMON_BASH_SETTING_FILE=/etc/profile | |
echo "install gcc..." | |
sudo yum -y install gcc | |
echo "install openssl-devel..." | |
sudo yum -y install openssl-devel | |
echo "install git..." | |
sudo yum -y install git | |
echo "download rbenv..." | |
git clone https://github.com/sstephenson/rbenv.git ${RBENV_INSTALL_DEST_DIR} | |
# add rbenv path To $PATH | |
echo "append rbenv path info To ${COMMON_BASH_SETTING_FILE}..." | |
echo "export RBENV_ROOT=\"${RBENV_INSTALL_DEST_DIR}\"" >> ${COMMON_BASH_SETTING_FILE} | |
echo 'export PATH="${RBENV_ROOT}/bin:$PATH"' >> ${COMMON_BASH_SETTING_FILE} | |
echo 'eval "$(rbenv init -)"' >> ${COMMON_BASH_SETTING_FILE} | |
# ${COMMON_BASH_SETTING_FILE} reload | |
echo "${COMMON_BASH_SETTING_FILE} reload" | |
source ${COMMON_BASH_SETTING_FILE} | |
echo "download rbenv plugin(ruby-build)..." | |
git clone https://github.com/sstephenson/ruby-build.git ${RBENV_INSTALL_DEST_DIR}/plugins/ruby-build | |
# install ruby | |
echo "ruby install..." | |
rbenv install -v 2.1.2 | |
rbenv global 2.1.2 | |
rbenv rehash | |
# set rbenv owner | |
chown -R vagrant:vagrant ${RBENV_INSTALL_DEST_DIR} |
This file contains 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::Config.run do |config| | |
config.vm.box = "centos64_6_5" | |
config.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box" | |
config.vm.provision "shell", path: "setup_rbenv.sh" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment