3

mac os x 10.8.5を実行しているVMWare Fusion VMでvagrantスクリプトによって実行されるchefを使用して、homebrewを使用してrubyをインストールしようとしています。

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

autoconfのインストールに失敗したhomebrewを使用してrbenvをインストールしようとしたときにも、このエラーが発生しました。/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

したがって、それは問題の一部である可能性があります。

もう1つは、homebrewをインストールしたのは誰ですか? 根?放浪者?誰が使用するかだけでなく、どこかに設定する必要があると思いますbrew install

于 2014-01-03T22:31:18.170 に答える