Skip to content

Instantly share code, notes, and snippets.

@aharpole
Forked from 8bitDesigner/.powrc
Last active March 12, 2024 23:11
Show Gist options
  • Save aharpole/d1194e08cec010375bb3 to your computer and use it in GitHub Desktop.
Save aharpole/d1194e08cec010375bb3 to your computer and use it in GitHub Desktop.
Everything you need to use RVM sanely. Check out the instructions in the rvm-setup file to get started.
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
#!/usr/bin/env bash
# save this in /usr/local/bin by running the following:
# $ curl -o /user/local/bin/rvm-setup https://gist.githubusercontent.com/aharpole/d1194e08cec010375bb3/raw/596bf4d9803bfa072bb598db142fca27d7276cd3/rvm-setup
# $ chmod +x /usr/local/bin/rvm-setup
echo "${PWD##*/}" > .ruby-gemset
curl -o .rvmrc https://gist.githubusercontent.com/aharpole/d1194e08cec010375bb3/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.3.0" > .ruby-version
fi
curl -o .powrc https://gist.githubusercontent.com/aharpole/d1194e08cec010375bb3/raw/4273909fcaf9ed7827f827b5cf8fc2d4c0465bbd/.powrc
cd .
@aharpole
Copy link
Author

aharpole commented Jun 1, 2016

To install this to your shell:

curl -o /usr/local/bin/rvm-setup https://gist.githubusercontent.com/aharpole/d1194e08cec010375bb3/raw/2cf48d045b49691f32b6a7488a02408c1af76e6b/rvm-setup
chmod +x /usr/local/bin/rvm-setup

@aharpole
Copy link
Author

aharpole commented Jun 1, 2016

Just run rvm-setup then type cd .. You'll be prompted to trust the .rvmrc file; just type "yes" and hit Enter. Boom. Done.

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