I recently changed from rvm to rbenv to manage my ruby environments and gems with bundle instead of rvm gemsets.

It worked well and I'm quite happy with the change. The only big problem is to manage rbenv with emacs. I cannot not get sometimes the correct ruby to work with rbenv and inf-ruby, specially if I'm not working with a rails project.

So for examples I have a directory with ruby files and a .ruby-version file. I also started to use rbenv , I use macOS Catalina, rbenv installed with homebrew, and normally start emacs with daemon and emacsclient from zsh console.

So first problem is setting the correct rbenv. (rbenv-use) doesn't work because do not find the correct rbenv executable, I also set the

(require 'rbenv)
(setf rbenv-installation-dir "/usr/local/opt/rbenv")

Then (rbenv-use-corresponding) works well, and I can see [2.4.6] in bar. But when I start inf-ruby I get Ruby-version 2.6.5.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.