Created
May 27, 2011 19:28
-
-
Save noservr/995953 to your computer and use it in GitHub Desktop.
Installs RVM (Ruby Version Manager) system wide
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
| #!/usr/bin/env bash | |
| # Installs RVM (Ruby Version Manager) system wide | |
| # Generate locals | |
| locale-gen en_US.UTF-8 | |
| # Upgrade system | |
| aptitude update && aptitude safe-upgrade -y | |
| # Packages needed to install RVM (Ruby Version Manager) | |
| aptitude install git-core curl -y | |
| # Install RVM | |
| bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) | |
| # Make sure rvm is loaded for non login shells - this inserts on lines 5, 6 and 7 | |
| sed -i '5i # This loads RVM into a shell session.' /root/.bashrc | |
| sed -i '6i [[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm"' /root/.bashrc | |
| sed -i '7i\ ' /root/.bashrc | |
| source /root/.bashrc | |
| # This are packages RVM needs to build Ruby (MRI & REE) for Ubuntu | |
| # run "rvm notes" to find packages needed for something else | |
| aptitude install -y build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev | |
| # Generating ri and rdoc take a long time... lets not | |
| echo "gem: --no-ri --no-rdoc" > ~/.gemrc | |
| echo "To install and use a default version of Ruby you might run:" | |
| echo "rvm install ruby-1.9.2 && rvm use ruby-1.9.2 --default" | |
| echo | |
| echo "Or if you must use the older Ruby:" | |
| echo "rvm install ree-1.8.7 && rvm use ree-1.8.7 --default" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment