3

我正在尝试使用自制软件安装 ruby​​,使用厨师,由运行 mac os x 10.8.5 的 VMWare 融合 VM 中的流浪脚本运行。

在 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

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

我还尝试添加:

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

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

我的食谱是这样的:

# 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

有任何想法吗?

4

1 回答 1

0

厨师文档中的语法如下所示:

package "ruby" do
  action :install
end

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

另一件事是,自制软件是由谁安装的?根?流浪汉?我假设您必须将其设置在某个地方,而不仅仅是使用brew install.

于 2014-01-03T22:31:18.170 回答