Ruby version not in ruby-build list for rbenv

后端 未结 5 1651
南方客
南方客 2021-01-15 15:56

I\'m using Rails 4.2 and wanted to update my Ruby version as well with rbenv.

I used Homebrew to install ruby-build and no matter how many times I try to update via

5条回答
  •  既然无缘
    2021-01-15 16:54

    If you installed rbenv and ruby-build with homebrew and when you do echo $(rbenv root), you get /usr/local/var/rbenv instead of /Users//.rbenv, here is how to fix the issue.


    When you install rbenv with homebrew, homebrew says:

    To use Homebrew's directories rather than ~/.rbenv add to your profile:
    export RBENV_ROOT=/usr/local/var/rbenv
    

    Don't do that. Remove that line from your profile. Make sure you refresh your terminal after.

    Then remove any signs of rbenv in the /usr/local/var directory:

    sudo rm -r /usr/local/var/rbenv
    

    Now when I do echo $(rbenv root) I get /Users//.rbenv instead of /usr/local/var/rbenv.

    That fixed it for me.

提交回复
热议问题