-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rbenv doesn't work with eshell #15
Comments
A little more data. My environment: Emacs 25.1 running the latest Emacs Prelude I ran the following code in my environment: (message "%s" exec-path) exec-path is what you expect, with the correct rbenv directories. However the eshell-path-env looks like the standard Mac shell settings. I tried running the following: (setq rbenv--initialized nil) (rbenv--setup) Which does fix the situation, but eshell is still a bit wonky. |
I was able to resolve the issue by putting the rbenv.el file into the prelude personal/preload directory, and requiring it and loading the global mode at the end of the file. This appears to be an issue related to the order that prelude executes things. For now, my setup is working, I'll see if I can make a PR request into prelude to fix the issue there. |
@lucaslward thanks for the heads up! It's possible that eshell uses some variable upon initialization. In that case rbenv would need to run before you load eshell. Let me know how it goes. |
I think i've noticed that before too. |
So, with the above fix, when I first load emacs, and load shell running ruby --version will give me the correct rbenv global that matches what's in my mode line. If, however, I cd into one of my project directories, running ruby --version will give me the Mac default ruby. Running the rbenv-use command will have no affect. Nor will running rbenv in eshell. It's worth noting that my .ruby-version file also matches global as well. This is not a file loaded via emacs client. |
Another strange wrinkle. If I start Emacs for the first time, and then immediately enter into eshell. As I said above, ruby --version will have the correct version. But when I CD into the project with my .ruby-version file, it will go back to the system ruby, as mentioned above. However, if I start emacs, then open a file in my project, then open eshell, which will default the directory to the current directory of the file I was in when evoking the shell, then the ruby version will be correct. This leads me to suspect something with how the shim is interacting with the path is the issue. I'm going to keep digging though. Any thoughts are appreciated. |
Hi @lucaslward I know it has been a very, very long time 😄 But I wanted to ask if you got to the bottom of the problem? I wanted to move over to e-shell, but the rbenv problem is preventing me from doing so. Thanks. |
So far, rbenv.el has been perfect to get rbenv working with emacs. Everything works except one thing: eshell. Ansi term works. Flycheck and rubocop work. inf-ruby and it's rails counterpart work correctly as well. So, it's very puzzling. Am I missing something? I just switched from RVM to rbenv. rvm.el used to have a problem where I would have to call rvm-use once per eshell session, and it would work thereafter. Doing the same with rbenv-use or use-global doesn't seem to have the same affect.
The text was updated successfully, but these errors were encountered: