Begin main content

Have rvm.el set your emacs rvm environment via .rvmrc

rvm has this great feature where you can put stuff into a .rvmrc file per project to ensure when you cd into any subdirectory of a given rails project you will have the right ruby/gem paths etc.

rvm.el enables that same environment to be set (globally) for an emacs process, with functions like rvm-activate-corresponding-ruby.

To get rvm.el to update globally when you cd into a dir in your emacs shell, just add the following to your .rvmrc after the rvm call to set the ruby/gemset:

emacsclient -n --eval '(rvm-activate-corresponding-ruby)'

(which of course assumes that your .emacs has (server-start) or similar).

07:26 AM, 05 Mar 2011 by Mark Aufflick Permalink

Add comment