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: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.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 accessDETAIL:  Permissions should be u=rwx (0700)In terminal I am: Linards:~ Berzins$ whoamiBerzinsLinards:~ Berzins$Ran the follwing in terminal:Linards:~ Berzins$ dscl . -read /Groups/admin    /System/Library/LaunchDaemons/com.apple.DirectoryServicesLocal.plist: No such file or directoryAppleMetaNodeLocation: /Local/DefaultGeneratedUID: ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000050GroupMembers: FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000 6F8DC3A8-D4B6-4175-B24A-1A99756706FAGroupMembership: root Linards Berzins Linards Linards BerzinsPassword: *PrimaryGroupID: 80RealName: AdministratorsRecordName: admin BUILTIN\AdministratorsRecordType: dsRecTypeStandard:GroupsSMBSID: S-1-5-32-544Linards:~ Berzins$ dscl . -read /Groups/staff/System/Library/LaunchDaemons/com.apple.DirectoryServicesLocal.plist: No such file or directoryAppleMetaNodeLocation: /Local/DefaultGeneratedUID: ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000014GroupMembers: FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000 6F8DC3A8-D4B6-4175-B24A-1A99756706FA FFFFEEEE-DDDD-CCCC-BBBB-AAAA000000ED FFFFEEEE-DDDD-CCCC-BBBB-AAAA000000EEGroupMembership: root Berzins _xcsbuildagent _xcscredserverPassword: *PrimaryGroupID: 20RealName: StaffRecordName: staff BUILTIN\UsersRecordType: dsRecTypeStandard:GroupsSMBSID: S-1-5-32-545Linards:~ Berzins$AND this: Linards:~ Berzins$ iduid=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$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. 
help for user permissions and file directory access mac OS Sierra
permissions;users;directory structure;not root user;permission denied