0o64yq
Last Updated: September 20, 2016
·
10.53K
· wilhelmbot
8579b71f9ed4dd34ae15f1d4b4ea428c

rbenv issues when switching to zsh

If you just switched from bash to zsh and have issues with rbenv and gem, then you should move rbenv initialization to ~/.zshenv

$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshenv
$ echo 'eval "$(rbenv init -)"' >> ~/.zshenv
$ echo 'source $HOME/.zshenv' >> ~/.zshrc
$ exec $SHELL

More info at https://github.com/sstephenson/rbenv

Say Thanks
Respond

6 Responses
Add your response

5308
665f654d7a5934bbced9468a519bc944

The $ echo 'eval "$(rbenv init -)"' bit should be changed to $ echo 'eval "$(rbenv init - zsh)"'. At least with rbenv 0.4.0.

Otherwise zsh complains of "complete" command not being available at shell start up (and you don't get the rbenv autocompletions either).

over 1 year ago ·
5832
665f654d7a5934bbced9468a519bc944

A follow up on my previous comment. The zsh argument to rbenv init is usually not required, but because of my situation (within a shell within emacs), it was was a workaround for $SHELL not being properly set in my environment.

By fixing what $SHELL was set to, things came right. That is a better way of addressing the problem.

over 1 year ago ·
5854
8579b71f9ed4dd34ae15f1d4b4ea428c

Thanks for the follow-up walter!

over 1 year ago ·
14655
395cdeac0e179f2fd46cd9527d4fea0e

This is actually fixed in HEAD version of rbenv.

over 1 year ago ·
20323
None

Thank you so much! This worked for me!

over 1 year ago ·
28168
None

Thanks for the tip rodowi

over 1 year ago ·
Filed Under