Last Updated: February 25, 2016
·
2.179K
· 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

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 ·

Very nice!

over 1 year ago ·