0

Im trying to sort my usrers and usser permission in terminal to install Ruby gems and other libraries, but getting nowhere because of the permissions denied errors. Steps I tried:

  1. Had a call with apple to sort out my user permissions, executed this command

    diskutil resetUserPermissions / id -u

NOTE: id -u was in `` (code editing strips it out here). It did not work. still getting permission errors.

  1. Tried to run Postgres (installed from GUI), getting

    FATAL FATAL: role "Berzins" does not exist); (FATAL: data directory "/Users/Linards/Library/Application Support/Postgres/var-9.6" has group or world access DETAIL: Permissions should be u=rwx (0700)

In terminal I am:

Linards:~ Berzins$ whoami
Berzins
Linards:~ Berzins$
  1. Ran the follwing in terminal:

Linards:~ Berzins$ dscl . -read /Groups/admin /System/Library/LaunchDaemons/com.apple.DirectoryServicesLocal.plist: No such file or directory AppleMetaNodeLocation: /Local/Default GeneratedUID: ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000050 GroupMembers: FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000 6F8DC3A8-D4B6-4175-B24A-1A99756706FA GroupMembership: root Linards Berzins Linards Linards Berzins Password: * PrimaryGroupID: 80 RealName: Administrators RecordName: admin BUILTIN\Administrators RecordType: dsRecTypeStandard:Groups SMBSID: S-1-5-32-544 Linards:~ Berzins$ dscl . -read /Groups/staff /System/Library/LaunchDaemons/com.apple.DirectoryServicesLocal.plist: No such file or directory AppleMetaNodeLocation: /Local/Default GeneratedUID: ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000014 GroupMembers: FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000 6F8DC3A8-D4B6-4175-B24A-1A99756706FA FFFFEEEE-DDDD-CCCC-BBBB-AAAA000000ED FFFFEEEE-DDDD-CCCC-BBBB-AAAA000000EE GroupMembership: root Berzins _xcsbuildagent _xcscredserver Password: * PrimaryGroupID: 20 RealName: Staff RecordName: staff BUILTIN\Users RecordType: dsRecTypeStandard:Groups SMBSID: S-1-5-32-545 Linards:~ Berzins$

AND this:

Linards:~ Berzins$ id uid=501(Berzins) gid=20(staff) groups=20(staff),701(com.apple.sharepoint.group.1),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),33(_appstore),100(_lpoperator),204(_developer),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh) Linards:~ Berzins$

  1. Then ran the following:

Linards:~ Berzins$ dscl . append /Groups/admin GroupMembership Linards /System/Library/LaunchDaemons/com.apple.DirectoryServicesLocal.plist: No such file or directory <main> attribute status: eDSPermissionError <dscl_cmd> DS Error: -14120 (eDSPermissionError) Linards:~ Berzins$ dscl . append /Groups/admin GroupMembership Berzins /System/Library/LaunchDaemons/com.apple.DirectoryServicesLocal.plist: No such file or directory <main> attribute status: eDSPermissionError <dscl_cmd> DS Error: -14120 (eDSPermissionError) Linards:~ Berzins$

Now Im massively stuck.

Any help appreciated.

0

From an offline discussion, I understood you were trying to install postgresql on macOS.

From the documentation:

Homebrew

PostgreSQL can also be installed on macOS using Homebrew. Please see the Homewbrew documentation for information on how to install packages.

  1. Install homebrew: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Install postgresql from terminal: brew install postgresql.

My output:

$ brew install postgresql
Updating Homebrew...
==> Auto-updated Homebrew!


==> Downloading https://homebrew.bintray.com/bottles/postgresql-9.6.3.sierra.bot
######################################################################## 100.0%
==> Pouring postgresql-9.6.3.sierra.bottle.tar.gz
==> Using the sandbox
==> /usr/local/Cellar/postgresql/9.6.3/bin/initdb /usr/local/var/postgres
==> Caveats
If builds of PostgreSQL 9 are failing and you have version 8.x installed,
you may need to remove the previous version first. See:
  https://github.com/Homebrew/legacy-homebrew/issues/2510

To migrate existing data from a previous major version (pre-9.0) of PostgreSQL, see:
  https://www.postgresql.org/docs/9.6/static/upgrading.html

To migrate existing data from a previous minor version (9.0-9.5) of PostgreSQL, see:
  https://www.postgresql.org/docs/9.6/static/pgupgrade.html

  You will need your previous PostgreSQL installation from brew to perform `pg_upgrade`.
  Do not run `brew cleanup postgresql` until you have performed the migration.

To have launchd start postgresql now and restart at login:
  brew services start postgresql
Or, if you don't want/need a background service you can just run:
  pg_ctl -D /usr/local/var/postgres start
==> Summary
🍺  /usr/local/Cellar/postgresql/9.6.3: 3,259 files, 36.6MB

You could also just download the .app and use that.

  • 2
    It sounds like the OP had managed to install Postgres, but was having permissions problems; this Answer doesn't appear to address any permissions issues. – Jeff Schaller May 20 '17 at 10:30
  • Thanks @Stefan, that is all nice and straight forward what you suggested, however as Jeff pointed out, im having the permissions errors on my system. Cheers – Linards Berzins May 21 '17 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.