权限错误通过自制软件通过主厨在osx上通过vagrant安装ruby

时间:2013-10-16 15:38:42

标签: macos chef homebrew vagrant

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

在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

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

来自chef doc的语法如下所示:

package "ruby" do
  action :install
end

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

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