Installing in Homebrew errors

后端 未结 8 2011
遥遥无期
遥遥无期 2020-12-04 05:38

Attempting to install rvm and ruby 1.9.2

I already installed homebrew and git, but couldn\'t get complete updates because I kept getting permission errors. Re-install

相关标签:
8条回答
  • 2020-12-04 06:15

    uninstall and re install HomeBrew that will do the trick

    0 讨论(0)
  • 2020-12-04 06:16

    I suggest ensuring that the current user is a member of the group that owns /usr/local. I believe by default, that group is wheel. To make yourself a member of that group:

    $ sudo dscl . append /Groups/wheel GroupMembership $USER
    

    Although something of an inelegant hammer, it has the intended effect - enabling access to items in /usr/local that are intended only for use (read/write) by elevated members. This approach has benefits of the other above because it takes advantage of the group memberships, enabling multiple (authorized) users on the system to use homebrew.

    0 讨论(0)
  • 2020-12-04 06:19

    How did you install Homebrew? Their official installation instructions include running a ruby script. That should take care of the permission issues for you.

    If you don't want to run a script, there is a section of that page called "Installing to /usr/local for Developers" that explains the change in permissions needed for the /usr/local directory.

    0 讨论(0)
  • 2020-12-04 06:21

    You can allow only Admin users writing into /usr/local/?

    chgrp -R admin /usr/local
    chmod -R g+w /usr/local
    chgrp -R admin /Library/Caches/Homebrew
    chmod -R g+w /Library/Caches/Homebrew
    

    Since that each user who belongs to Admin group, will be able to install new dependencies.

    0 讨论(0)
  • 2020-12-04 06:22

    EDIT: As mentioned in the comments it's a bad idea to use sudo with homebrew, so don't use the following answer!


    You can also prevent this error if you execute the command with sudo:

    $ sudo brew install wget
    

    But take care of using sudo because you can make a lot of mistakes.

    0 讨论(0)
  • 2020-12-04 06:23

    On High Sierra you need the following command cause chown will not work:

    sudo chown -R $(whoami) $(brew --prefix)/*

    Link:

    https://github.com/Homebrew/brew/issues/3228

    0 讨论(0)
提交回复
热议问题