Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get inf-ruby to use ruby version manager (rvm)

I have the ruby version manager installed and use the ruby implementation installed by RVM set to the default so that 'which ruby' shows '~/.rvm/ruby-1.8.6-p383/bin/ruby' yet when I open an inf-ruby buffer in emacs, it uses the ruby installed in /usr/bin.

Is there a way to get emacs to respect the path for ruby the same way the shell does?

Thanks!

like image 997
calstad Avatar asked Oct 14 '09 21:10

calstad


2 Answers

I created a emacs extension to integrate rvm into emacs. If you are interested you can get it here: http://github.com/senny/rvm.el

like image 100
senny Avatar answered Sep 23 '22 07:09

senny


I know this is an old question, but it might help someone else with the same type of problem in the future.

I have installed Ruby/Rails via rvm, set the default Ruby version I want to use.

I then installed rvm via emacs ELPA package manager.

I added the following to my ~/.emacs:

(require 'rvm)  
(rvm-use-default)

I can now run emacs and open eshell/shell and everything is working as expected.

like image 20
Jeff Avatar answered Sep 19 '22 07:09

Jeff