Ruby gem 및 기타 라이브러리를 설치하기 위해 터미널에서 사용자 및 사용자 권한을 정렬하려고 하는데 권한 거부 오류가 발생하여 아무런 결과도 얻지 못합니다. 내가 시도한 단계:
내 사용자 권한을 정렬하기 위해 Apple에 문의하려면 다음 명령을 실행하세요.
diskutil resetUserPermissions / id -u
참고: id -u는 ``에 있습니다(코드 편집기에서 제거됨). 작동하지 않습니다. 여전히 권한 오류가 발생합니다.
Postgres(GUI에서 설치)를 실행하려고 하면 다음과 같은 메시지가 나타납니다.
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)
터미널에서 나는:
Linards:~ Berzins$ whoami
Berzins
Linards:~ Berzins$
- 터미널에서 다음 명령을 실행합니다.
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$
이:
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$
- 그런 다음 다음 명령을 실행하십시오.
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$
이제 나는 막혔습니다.
도움을 주시면 감사하겠습니다.
답변1
오프라인 토론을 통해 macOS에 postgresql을 설치하려고 한다는 것을 알고 있습니다.
~에서문서:
스스로 만든
PostgreSQL은 Homebrew를 사용하여 macOS에 설치할 수도 있습니다. 패키지 설치 방법에 대한 자세한 내용은 Homewbrew 설명서를 참조하세요.
- 설치하다집에서 만든:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- 터미널에서 postgresql을 설치하십시오:
brew install postgresql
.
내 결과:
$ 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