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).
(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
Ruby: Converting a Nested Ruby Hash to an Un-Nested One
What Is Ruby's Stringio Class Really
Why Slicing The Params Hash Poses a Security Issue on Mass-Assignment
How to Change "3 Errors Prohibited This Foobar from Being Saved" Validation Message in Rails
Facebook Redirect Url in Ruby on Rails Open Ssl Error
Explanation of Ruby Code for Building Trie Data Structures
How to Find Word with The Greatest Number of Repeated Letters
How to Properly Manage The Rails Tmp Directory
How to Handle Single Table Inheritance in Simpleform So a Single Helper Handles All Models
Ruby 1.9 How to Convert Array to String Without Brackets
What Ruby Technique Does Rails Use to Make My Controller Methods Render Views
International Chars Using Rspec with Ruby on Rails
Deleting Items from an Array Requires Multiple Passes to Remove Them All
Gem Install Rmagick Fails on Os X El Capitan
How to Add a User Interrupt to an Infinite Loop
How to Fix Difference in Behavior of Activesupport 3.0.0 Compare to 2.X