Created
January 14, 2013 05:01
-
-
Save joemaller/4527868 to your computer and use it in GitHub Desktop.
A little script for boostrapping a basic ruby rbenv environment. The script installs rbenv and ruby-build from Homebrew, activates a new rbenv and then installs the rbenv-rhash and compass gems.
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 | |
| # This script bootstraps a basic ruby rbenv environment using Homebrew | |
| # | |
| # Should be executed in the current shell by calling from source (or dot): | |
| # $ source ./.rbenv | |
| # $ . ./.rbenv | |
| RUBY_VERSION='1.9.3-p362' | |
| echo "Installing rbenv, and ruby-build" | |
| brew update | |
| brew install rbenv | |
| brew install ruby-build | |
| echo "Backing up .bashrc" | |
| cp ~/.bashrc ~/$(date +.bashrc.backup_%Y_%m_%d_%H:%M:%S) | |
| echo ' | |
| # Enable Ruby rbenv (via Homebrew) | |
| if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi | |
| ' >> ~/.bashrc | |
| echo "Installing Ruby $RUBY_VERSION to rbenv" | |
| rbenv install $RUBY_VERSION | |
| rbenv global $RUBY_VERSION | |
| echo "Initializing rbenv" | |
| eval "$(rbenv init -)" | |
| echo "Installing rbenv-rehash" | |
| gem install rbenv-rehash | |
| rbenv rehash | |
| echo "Installing Compass Gem" | |
| gem install compass | |
| echo "Sourcing .bashrc" | |
| source ~/.bashrc | |
| echo "All done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment