当前位置:  开发笔记 > 编程语言 > 正文

无法通过Homebrew安装Ruby,Permission denied错误

如何解决《无法通过Homebrew安装Ruby,Permissiondenied错误》经验,为你挑选了1个好方法。

作为一个全新的编程人员,我试图使用自制软件安装Ruby.安装一直停留在'openssl'阶段.这似乎取决于目录的权限:

/usr/local/etc/openssl/

在线和其他地方的研究指出试图通过Homebrew单独安装'openssl',我已经完成并以错误结束:

==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2e.yosemite.bot
Already downloaded: /Library/Caches/Homebrew/openssl-1.0.2e.yosemite.bottle.tar.gz
==> Pouring openssl-1.0.2e.yosemite.bottle.tar.gz
Error: Permission denied - /usr/local/etc/openssl/certs
Warning: Bottle installation failed: building from source.
==> Downloading https://www.openssl.org/source/openssl-1.0.2e.tar.gz
Already downloaded: /Library/Caches/Homebrew/openssl-1.0.2e.tar.gz
==> perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.2e --openssldir=/usr
==> make depend

==> make
==> make test
==> make install MANDIR=/usr/local/Cellar/openssl/1.0.2e/share/man MANSUFFIX=ssl
Last 15 lines from /Users/Joe/Library/Logs/Homebrew/openssl/05.make:
SSL_want_read.3ssl => SSL_want.3ssl
SSL_want_write.3ssl => SSL_want.3ssl
SSL_want_x509_lookup.3ssl => SSL_want.3ssl
installing man3/SSL_write.3ssl
installing man3/d2i_SSL_SESSION.3ssl
i2d_SSL_SESSION.3ssl => d2i_SSL_SESSION.3ssl
installing man3/ssl.3ssl
Cannot create directory /usr/local/etc/openssl/certs: Permission denied
created directory `/usr/local/Cellar/openssl/1.0.2e/bin'
created directory `/usr/local/Cellar/openssl/1.0.2e/lib'
created directory `/usr/local/Cellar/openssl/1.0.2e/lib/engines'
created directory `/usr/local/Cellar/openssl/1.0.2e/lib/pkgconfig'
created directory `/usr/local/Cellar/openssl/1.0.2e/include'
created directory `/usr/local/Cellar/openssl/1.0.2e/include/openssl'
make: *** [install_sw] Error 13

所以我使用'chown'来更改/ openssl /目录的所有权并设法进一步改进但现在我遇到了这个错误:

==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2e.yosemite.bot
Already downloaded: /Library/Caches/Homebrew/openssl-1.0.2e.yosemite.bottle.tar.gz
==> Pouring openssl-1.0.2e.yosemite.bottle.tar.gz
Error: Permission denied - /usr/local/etc/openssl/misc/c_hash
Warning: Bottle installation failed: building from source.
==> Downloading https://www.openssl.org/source/openssl-1.0.2e.tar.gz
Already downloaded: /Library/Caches/Homebrew/openssl-1.0.2e.tar.gz
==> perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.2e --openssldir=/usr
==> make depend
==> make
==> make test
==> make install MANDIR=/usr/local/Cellar/openssl/1.0.2e/share/man MANSUFFIX=ssl
Last 15 lines from /Users/Joe/Library/Logs/Homebrew/openssl/05.make:
            *DSO_WIN32*) sfx="eay32.dll"; pfx=;; \
            *) sfx=".bad";; \
            esac; \
            cp ${pfx}gost$sfx /usr/local/Cellar/openssl/1.0.2e/lib/engines/${pfx}gost$sfx.new; \
        fi; \
        chmod 555 /usr/local/Cellar/openssl/1.0.2e/lib/engines/${pfx}gost$sfx.new; \
        mv -f /usr/local/Cellar/openssl/1.0.2e/lib/engines/${pfx}gost$sfx.new /usr/local/Cellar/openssl/1.0.2e/lib/engines/${pfx}gost$sfx; \
    fi
installing gost
making install in apps...
installing openssl
installing CA.sh
cp: /usr/local/etc/openssl/misc/CA.sh.new: Permission denied
make[1]: *** [install] Error 1
make: *** [install_sw] Error 1

再次,关于openssl文件夹中的事物的权限?

有谁知道如何改变这个?

我想最让我困惑的事情是,我是这台计算机上的唯一用户,因此也是唯一的管理员,所以我无法理解为什么我没有权限访问任何东西?

我尝试过的另外两件事:

在命令之前使用sudo

完全重新安装OS X.

在此先感谢您的帮助.



1> Mike S..:

仅仅是计算机上唯一的管理员用户并不意味着您使用该用户运行的所有命令都将以root权限运行.即使您没有获得GUI登录,机器内仍有一个单独的root用户.这将是一个安全风险,它还有助于防止您通过运行破坏性命令而不会sudo在它前面拍打而意外地挂起自己.

您有两种方法可以解决此问题:

    调整安装程序所需的每个目录的权限(在本例中/usr/local/etc/openssl/misc).看起来它需要基于错误的写入权限.但是,一旦超过该特定错误,可能会有更多目录.

你可以像这样完全打开它:

chmod -R 777 /usr/local/etc/openssl/misc

或者chown你自己的一切:

chown -R "$USER":admin /usr/local

    brew以root用户身份运行(或使用root权限sudo).这将要求您chownbrew可执行文件设置为root而不是您的用户.

推荐阅读
mobiledu2402851373
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有