1

I'm getting the following permission error, What I can do to fix this. I'm new to brew.

I have two users one is an administrator, which i used to install packages and I am able to run pub get using that user but my other user not able to do it. How can make it working fo the normal user?

$ pub get
/usr/local/bin/pub: line 2: 
/usr/local/Cellar/dart/2.1.0/libexec/bin/pub: Permission denied
/usr/local/bin/pub: line 2: exec: 
/usr/local/Cellar/dart/2.1.0/libexec/bin/pub: cannot execute: Permission denied

Seems like some permission with current user and where I installed dart.

As per the request from @JBallin adding brew doctor output here:

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. 

Warning: Broken symlinks were found. Remove them with `brew cleanup`:
/usr/local/bin/dart

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
/usr/local/lib/libpcre.1.dylib
/usr/local/lib/libpcre2-8.0.dylib
/usr/local/lib/libpcre2-posix.1.dylib
/usr/local/lib/libpcrecpp.0.dylib
/usr/local/lib/libpcreposix.0.dylib
/usr/local/lib/libtcl8.6.dylib
/usr/local/lib/libtk8.6.dylib

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
/usr/local/lib/libpcre.la
/usr/local/lib/libpcre2-8.la
/usr/local/lib/libpcre2-posix.la
/usr/local/lib/libpcrecpp.la
/usr/local/lib/libpcreposix.la

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
/usr/local/lib/pkgconfig/libpcre.pc
/usr/local/lib/pkgconfig/libpcre2-8.pc
/usr/local/lib/pkgconfig/libpcre2-posix.pc
/usr/local/lib/pkgconfig/libpcrecpp.pc
/usr/local/lib/pkgconfig/libpcreposix.pc
/usr/local/lib/pkgconfig/tcl.pc
/usr/local/lib/pkgconfig/tk.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
/usr/local/lib/libpcre.a
/usr/local/lib/libpcre2-8.a
/usr/local/lib/libpcre2-posix.a
/usr/local/lib/libpcrecpp.a
/usr/local/lib/libpcreposix.a
/usr/local/lib/libtclstub8.6.a
/usr/local/lib/libtkstub8.6.a

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
pcre

Warning: Some installed formulae are missing dependencies.
You should `brew install` the missing dependencies:
brew install php

Run `brew missing` for more details.

Please see the above information for brew doctor.

Thanks.

Unnikrishnan
  • 2,683
  • 5
  • 22
  • 39
  • Please post the output of “$ brew doctor” – JBallin Mar 17 '19 at 06:14
  • @JBallin - I have included brew doctor information in the question, could you please check? – Unnikrishnan Mar 17 '19 at 06:31
  • Great. Now try following those instructions and report back. – JBallin Mar 17 '19 at 06:35
  • @JBallin - I have fixed those brew issue `$ brew doctor brew doctor --list-checks | grep -v stray_headers` Your system is ready to brew.`. Now what i need to do? – Unnikrishnan Mar 17 '19 at 07:03
  • brew doctor shows no issues and it's still not working? – JBallin Mar 17 '19 at 07:11
  • @JBallin Yes it's still not working it's permission issue, I have two users one is an administrator where I can able to run it but my other user not able to do it. How can make it working fo the normal user? – Unnikrishnan Mar 17 '19 at 07:14
  • Try `sudo chown -R $(whoami) $(brew --prefix)/*` or `sudo chown -R $(whoami):admin $(brew --prefix)/*` SOURCE: https://stackoverflow.com/q/16432071/4722345 – JBallin Mar 17 '19 at 07:25
  • @JBallin - it's a multiuser system if i do the above, I won't be able to use brew as other users. Is there any way I can add my user to a group and give permission to that group? – Unnikrishnan Mar 17 '19 at 07:34
  • Not sure about that. Sounds like a good question though. May want to edit this one to ask about that specifically. – JBallin Mar 17 '19 at 07:44
  • @JBallin - I think we have a similar issue here: https://stackoverflow.com/questions/16432071/how-to-fix-homebrew-permissions I think this is a duplicate question :( nothing to do with dart. – Unnikrishnan Mar 17 '19 at 07:47
  • There seems to be a general issue when multiple system users are involved. I get a similar error when dart is called from a php-fpm process (which runs under the _www user). – Steffen Roßkamp Sep 20 '19 at 13:43

0 Answers0