greewq
Last Updated: February 25, 2016
·
1.987K
· amiel

Using pow with rvm's new ruby-version and ruby-gemset

RVM recently switched from .rvmrc to .ruby-version and .ruby-gemset.
If you have a .powrc that was generated by pow for .rvmrc, use this instead.

# .powrc
if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ]; then
  source "$rvm_path/scripts/rvm"
  rvm use `cat .ruby-version`@`cat .ruby-gemset`
fi

2 Responses
Add your response

15028

I revised it a bit, so not more forking to cat:

if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ]; then
  source "$rvm_path/scripts/rvm"
  RUBY_VERSION=$(< "$PWD/.ruby-version")
  RUBY_GEMSET=$(< "$PWD/.ruby-gemset")
  rvm $RUBY_VERSION@$RUBY_GEMSET
fi
over 1 year ago ·
15031

Very nice!

over 1 year ago ·