Using RVM in eshell of Emacs
Asked Answered
N

2

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]
Numen answered 2/4, 2011 at 4:16 Comment(0)
N
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.

Naiad answered 2/4, 2011 at 5:27 Comment(1)
+1 for rvm.el. I use it all the time for switching between my private projects (1.9.2) and work (1.8.7).Bassesalpes
C
-3

You also can write

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

to your .bashrc

good luck

Castrate answered 28/2, 2012 at 4:6 Comment(3)
This does not apply to eshellWatford
This will work with M-x shell (i.e., a default shell invocation). However, it fails with eshell (Emacs shell).Earthquake
-1 because this does not apply to eshell and confuses the issue. Eshell is not a standard shell and does not use .bashrcNitrobacteria

© 2022 - 2024 — McMap. All rights reserved.