虽然以前我已经能够通过rbenv安装ruby版本,升级到优胜美地后,我不断收到以下错误:
rbenv: no such command 'install'
在挖掘之后,我看到很多关于“安装”来自于通过homebrew安装的ruby-build插件的提示:
which ruby-build /usr/local/bin/ruby-build
我通过Homebrew安装了rbenv,但是当我尝试使用哪个rbenv,我得到:
rbenv () { typeset command command="$1" if [ "$#" -gt 0 ] then shift fi case "$command" in (rehash|shell) eval `rbenv "sh-$command" "$@"` ;; (*) command rbenv "$command" "$@" ;; esac }
我已经运行brew update和brew升级rbenv ruby-builder,它告诉我一切都是最新的.
以下是我的完整$PATH:
zsh:没有这样的文件或目录:/usr/local / var / rbenv / shims:/usr/local / var / rbenv / shims:/usr/local / bin:/usr/local / sbin:/ Users / dannycox /. rbenv /垫片:/Users/dannycox/.rbenv/shims:在/usr/local / bin目录:在/usr/bin中:/ bin中:/usr/sbin目录:/ sbin目录中:/ opt / X11 / bin中:在/ usr /本地/去/bin:/Users/dannycox/.rbenv/shims:/Users/dannycox/.rbenv/bin
更新:找到另一个答案,更深入地挖掘github,表现出希望的迹象,但未能解决rbenv的问题. https://github.com/sstephenson/rbenv/issues/610#issuecomment-56240018
我相信2.1.4现在安装在我的机器上,但它安装在这里:
成功地将ruby 2.1.4安装到/Users/dannycox/.rubies/ruby-2.1.4中
因此,我的bundler将不能使用新的ruby 2.0版本,当我尝试gem安装捆绑包时,我收到以下错误:
Fetching: bundler-1.7.6.gem (100%) ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory
仍然需要帮助,以确定为什么ruby-build不是很好用rbenv …
解决方法
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
安装ruby-build,它提供了简化安装新Ruby版本的过程的rbenv install命令.