gpt4 book ai didi

macos - 权限错误通过 osx 上的 vagrant 通过 Chef 通过 Homebrew 软件安装 ruby

转载 作者:行者123 更新时间:2023-12-02 04:58:17 24 4
gpt4 key购买 nike

我正在尝试使用 homebrew 安装 ruby​​,使用 chef,由运行 mac os x 10.8.5 的 VMWare fusion VM 中的 vagrant 脚本运行。

在安装 ruby​​ 时,出现以下错误:

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of brew install ruby ----
STDOUT: ==> Installing dependencies for ruby: pkg-config, readline, libyaml, openssl
==> Installing ruby dependency: pkg-config
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/pkg-config- 0.28.mountain_lion.bottle.tar.gz
==> Pouring pkg-config-0.28.mountain_lion.bottle.tar.gz
🍺 /usr/local/Cellar/pkg-config/0.28: 10 files, 636K
==> Installing ruby dependency: readline
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/readline-6.2.4.mountain_lion.bottle.tar.gz
==> Pouring readline-6.2.4.mountain_lion.bottle.tar.gz
==> Caveats
This formula is keg-only: so it was not symlinked into /usr/local.

OS X provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

LDFLAGS: -L/usr/local/opt/readline/lib
CPPFLAGS: -I/usr/local/opt/readline/include

==> Summary
🍺 /usr/local/Cellar/readline/6.2.4: 31 files, 1.6M
==> Installing ruby dependency: libyaml
==> Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
STDERR: Error: Permission denied - /var/root/Library/Logs
---- End output of brew install ruby ----
Ran brew install ruby returned 1

当我尝试使用 homebrew 安装 rbenv 时,我也遇到了这个错误,但安装 autoconf 失败了。我不确定它为什么要访问/var/root/。当我从 VM 运行“brew install autoconf”时,它安装正常。

我也尝试添加:

node.default['homebrew']['owner'] = 'vagrant'

我的 Recipe 只是为了确保 Homebrew 软件安装使用的是本地用户,但这没有任何区别。

我的 Recipe 是这样的:

# required for homebrew
bash "take-usr-local-ownership" do
user "vagrant"
cwd "/"
code <<-EOH
sudo mkdir -p /usr/local
sudo chown -R `whoami`:staff /usr/local
EOH
end

include_recipe 'homebrew'

# Install each of the packages using the `package` resource
%w(ruby).each do |package|
package package
end

有什么想法吗?

最佳答案

chef 文档中的语法如下所示:

package "ruby" do
action :install
end

所以这可能是问题的一部分。

另一件事是,谁安装了 homebrew?根? Vagrant ?我假设您必须在某个地方设置它,而不仅仅是谁使用 brew install

关于macos - 权限错误通过 osx 上的 vagrant 通过 Chef 通过 Homebrew 软件安装 ruby,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19407747/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com