Set the default rvm interpreter to user.rvmrc?

I'm curious if my Ruby interpreter can be installed in my $HOME/.rvmrc (i.e. the equivalent of rvm --default use 1.9.2 ).

I tried installing rvm_ruby_interpreter and rvm_ruby_version , but no luck.

+7
source share
3 answers

Just tidying up my unanswered questions ... I eventually accepted Frogz’s offer and added it to my .zprofile :

 RVM_DEFAULT=ruby-1.9.3-p194@home if [ -x ~/.rvm/bin/rvm-prompt ] && [ "$(~/.rvm/bin/rvm-prompt)" != $RVM_DEFAULT ] ; then rvm use $RVM_DEFAULT fi 

Looking back, this is some kind of weird question, probably due to the fact that I was new to rvm and relatively new to Ruby (but familiar with Unix and dotfiles).

+1
source

You cannot in the $ HOME / .rvmrc or / etc / rvmrc file, but you can in the .rvmrc project files by entering rvm <interpreter> . Therefore, if you want 1.9.2 for one project, but ree for another, enter rvm 1.9.2 in the first project file .rvmrc and rvm ree in another project file .rvmrc. You can also automatically activate gemset in this way.

Source: https://rvm.beginrescueend.com/workflow/rvmrc/

0
source

If you have projects using .rvmrc (or .ruby-version / .ruby-gemset) and want your home directory to install these envars on something else (no matter how many times you cd here and there) try this is in ~ / .bashrc:

 PROMPT_COMMAND='[[ $PWD = $HOME ]] && (rvm use default; rvm gemset use global) > /dev/null' 

Substituting your favorite fragrances for default and global , of course.

0
source

All Articles