Skip to content
This repository has been archived by the owner on Nov 11, 2021. It is now read-only.

install.sh fails when brew is installed by different user #30

Closed
TheDauntless opened this issue Aug 23, 2018 · 3 comments
Closed

install.sh fails when brew is installed by different user #30

TheDauntless opened this issue Aug 23, 2018 · 3 comments
Assignees
Milestone

Comments

@TheDauntless
Copy link

Describe the bug
When running install.sh, the script fails early because of wrong permissions of brew.

To Reproduce

  1. Create new OS X user
  2. Install brew through user1
  3. Run install.sh from user2

Expected behavior
It works

Terminal output

/install.sh
Platform check: OK. Proceeding with Mac OS X version check.
Detected compatible version of Mac OS X! Proceeding with installation.
/usr/local/bin/brew
proceeding: brew installed
Installing Ansible
Error: No such keg: /usr/local/Cellar/ansible
Error: /usr/local/Cellar is not writable. You should change the
ownership and permissions of /usr/local/Cellar back to your
user account:
 sudo chown -R $(whoami) /usr/local/Cellar
Error: Cannot write to /usr/local/Cellar
Error: No such keg: /usr/local/Cellar/ansible
installing necessary roles

Desktop (please complete the following information):

  • OS: MacOS 10.13.6 (17G65)
  • Latest

Additional context
A fix is to create a group for brew and change the permissions (https://gitlab.com/alyda/dotfiles/snippets/19654). This would be outside of the scope of the install.sh script, but a sensible error message would be nice.

@TheDauntless
Copy link
Author

The recommendation doesn't work since High Sierra (Homebrew/brew#3228). So maybe a separate info page on this project is appropriate.

When "admin" is the group where your users are in:

chgrp -R admin /usr/local/*
chmod -R g+w /usr/local/*

@commjoen commjoen self-assigned this Aug 27, 2018
@commjoen commjoen added this to To do in mobilehacktools via automation Aug 27, 2018
@commjoen commjoen added this to the 0.2 - Next milestone Aug 27, 2018
@commjoen
Copy link
Contributor

Will add it soon to the readme as a separate item. Same holds for https://github.com/geerlingguy/macos-virtualbox-vm to allow others to use it :)

@commjoen
Copy link
Contributor

Fixed in #38

mobilehacktools automation moved this from To do to Done Sep 11, 2018
commjoen added a commit that referenced this issue Sep 11, 2018
commjoen added a commit that referenced this issue Sep 15, 2018
TheDauntless deserves the credit for reporting issue #30. Not me.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Development

No branches or pull requests

2 participants