8

Using RVM in eshell of emacs, I am not able to set the ruby version. Why? Environment : Ubuntu 9.10

/media/Work/rubyworkspace $ ruby -v 
ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]
/media/Work/rubyworkspace $ rvm use 1.9.2
Using /usr/local/rvm/gems/ruby-1.9.2-p180
/media/Work/rubyworkspace $ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]

2 Answers 2

13

As far as I can tell, RVM relies on the shell being a "regular" UNIX shell. Selection of the correct interpreter etc. is done using shell variables and these don't apply to eshell which has it's own way of configuring stuff.

One solution is to use M-X term and then use a regular shell inside that. The other is to give rvm.el a shot. I personally have not tried either.

1
  • 2
    +1 for rvm.el. I use it all the time for switching between my private projects (1.9.2) and work (1.8.7). Apr 2, 2011 at 8:29
-3

You also can write

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

to your .bashrc

good luck

3
  • 1
    This does not apply to eshell
    – Pedro Rolo
    Feb 28, 2012 at 14:33
  • This will work with M-x shell (i.e., a default shell invocation). However, it fails with eshell (Emacs shell).
    – Anupam
    Feb 27, 2013 at 2:42
  • -1 because this does not apply to eshell and confuses the issue. Eshell is not a standard shell and does not use .bashrc
    – huntar
    Mar 10, 2014 at 1:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.