Last active
August 26, 2024 20:44
-
-
Save nbibler/5307941 to your computer and use it in GitHub Desktop.
A .powrc file which works with RVM's .rvmrc or .ruby-version (+ .ruby-gemset) configuration files.
This file contains 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
if [ -f "$rvm_path/scripts/rvm" ]; then | |
source "$rvm_path/scripts/rvm" | |
if [ -f ".rvmrc" ]; then | |
source ".rvmrc" | |
fi | |
if [ -f ".ruby-version" ]; then | |
rvm use `cat .ruby-version` | |
fi | |
if [ -f ".ruby-gemset" ]; then | |
rvm gemset use --create `cat .ruby-gemset` | |
fi | |
fi |
try this version https://gist.github.com/mpapis/5364653 - should work more reliable
@mpapis You completely removed the .ruby-version
and .ruby-gemset
support. Was that intentional? That relies on rvm's current. I'm missing how it's changing to the appropriate version using rvm, based on the most compatible way to set these (using .ruby-version
and .ruby-gemset
).
I tried this, but the variable $rvm_path
is empty inside .powrc
. The variable does contain the right info when I execute it on my normal shell. Any ideas on what could be wrong?
Faster: don't do "rvm use" twice: https://gist.github.com/flarik/5764244
I believe this has an error in it. The line:
rvm gemset use --create cat .ruby-gemset
should be:
rvm gemset use cat .ruby-gemset
--create
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this elaboration of the original post. Much appreciated.