Using Rvm in Eshell of Emacs

Using RVM in eshell of Emacs

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.

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

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

Emacs fails to load ruby gems unless invoked from zsh

Got the solution.
rvm package is what I needed

M-x package-install rvm
M-x rvm-use-default
M-x bundle-install

Works like a charm :)
Edit:

Adding the following to init.el make life more easy

(rvm-use-default)

Emacs shell can't find ruby gems -- e.g., Could not find RubyGem haml (= 0) (Gem::LoadError)

Make sure your GEM_HOME environment variable is set properly or you may have trouble. rvm does move this from the usual location, and bundler can move it again.

This is particularly important if you're loading gems from your home directory because they are managed by rvm.

Emacs is ignoring my path when it runs a compile command

A small modification to the solution by sanityinc (couldn't find a way to enter it in the comments above -- is that just me?)

  • I use -l option to the shell to force a login shell (which reads .profile or .bash_profile), rather than an interactive shell (which only reads .bashrc).
  • I do some string trimming on the returned path (as inspection shows a newline sneaking in).

Modified code:

(defun set-exec-path-from-shell-PATH ()
(let ((path-from-shell
(replace-regexp-in-string "[[:space:]\n]*$" ""
(shell-command-to-string "$SHELL -l -c 'echo $PATH'"))))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
(when (equal system-type 'darwin) (set-exec-path-from-shell-PATH))


Related Topics



Leave a reply



Submit