Forked from robdimarco/bootstrap-rvm-and-chef-solo-on-ubuntu.sh
Last active
December 15, 2015 19:19
-
-
Save pepoviola/5310435 to your computer and use it in GitHub Desktop.
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
DEFAULT_RUBY_VERSION="1.9.3-p125" | |
sudo apt-get update | |
sudo apt-get -y install curl git-core bzip2 build-essential zlib1g-dev libssl-dev autoconf libreadline6-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libgdbm-dev libncurses5-dev libtool bison pkg-config libffi-dev | |
if [ -x /usr/local/rvm/bin/rvm ]; then | |
echo "RVM Found..nothing to do"; | |
else | |
echo "Installing RVM"; | |
curl -o /tmp/rvm-installer -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | |
chmod +x /tmp/rvm-installer | |
sudo /tmp/rvm-installer stable | |
has_rvm=`groups |grep -c rvm`; | |
if [ "$has_rvm" == "0" ]; then | |
sudo /usr/sbin/usermod -G `groups | tr ' ' ','`,rvm $USER | |
fi | |
fi | |
source /etc/profile | |
has_ruby_version=`rvm list | grep -c $DEFAULT_RUBY_VERSION` | |
if [ $has_ruby_version == "0" ]; then | |
rvm install $DEFAULT_RUBY_VERSION | |
# rvm system ; rvm gemset export system.gems ; rvm $DEFAULT_RUBY_VERSION; rvm gemset import system.gems | |
rvm alias create default $DEFAULT_RUBY_VERSION | |
else | |
echo "RVM has already installed Ruby v$DEFAULT_RUBY_VERSION" | |
fi | |
gem install chef --no-ri --no-rdoc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested in ubuntu minimal instalation over virtualbox