Skip to content

Instantly share code, notes, and snippets.

@8bitDesigner
Forked from nbibler/gist:5307941
Last active December 28, 2015 22:09
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save 8bitDesigner/7570000 to your computer and use it in GitHub Desktop.
Save 8bitDesigner/7570000 to your computer and use it in GitHub Desktop.
Everything you need to use RVM _sanely_.
if [ -f ".rvmrc" ]; then
source ".rvmrc"
fi
if [ -f "$rvm_path/scripts/rvm" ]; then
source "$rvm_path/scripts/rvm"
VERSION_FROM_GEMFILE=$(perl -ne '/^ruby .([0-9\.]+).$/ && print "$1"' Gemfile)
if [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
fi
if [[ -n $VERSION_FROM_GEMFILE ]]; then
rvm use $VERSION_FROM_GEMFILE
fi
if [ -f ".ruby-gemset" ]; then
rvm gemset use --create `cat .ruby-gemset`
fi
fi
@8bitDesigner
Copy link
Author

An rvm-setup script from @aharpole

#!/usr/bin/env bash
echo "${PWD##*/}" > .ruby-gemset
curl -o .rvmrc https://gist.githubusercontent.com/8bitDesigner/7570000/raw/4cc47262d16a777a6f087906f810110168b9164c/.rvmrc
VERSION_FROM_GEMFILE=$(perl -ne '/^ruby .([0-9\.]+).$/ && print "$1"' Gemfile)

if [[ -n $VERSION_FROM_GEMFILE ]]; then
  echo "$VERSION_FROM_GEMFILE" .ruby-version
else
  echo "2.1.1" > .ruby-version
fi

curl -o .powrc https://gist.githubusercontent.com/8bitDesigner/7570000/raw/4273909fcaf9ed7827f827b5cf8fc2d4c0465bbd/.powrc
cd .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment