LoginSignup
7
6

More than 5 years have passed since last update.

chef-ruby_buildで入れたruby-buildを更新する

Last updated at Posted at 2013-08-06

chefでrbenvを使ってrubyをインストールしようとしたところ以下のようなエラーに。

STDERR: Downloading ruby-2.0.0-p247.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
/usr/local/bin/ruby-build: line 144: pushd: ruby-2.0.0-p247: No such file or directory

BUILD FAILED

どうやらruby-buildでソースをダウンロードする際に ftp.ruby-lang.org にhttpでアクセスできなくなったのが原因のようです。
現在はftpで取得するよう修正されています。

しかし、chef-ruby_buildを利用している場合、既にruby-buildがインストールされていると更新がかからないようになっているので、以下のようにruby_buildのattributeにupgrade設定をする必要があります。

nodes/{host_name}.json
{
  "ruby_build": {
    "upgrade": "sync"
  },
  "rbenv": {
    "user_installs": [
      {
        "user": "app",
        "rubies": ["2.0.0-p247"],
        "global": "2.0.0-p247",
        "gems": {
          "2.0.0-p247": [
            { "name": "bundler" }
          ]
        }
      }
    ]
  },
  "run_list": [
    "recipe[ruby_build]",
    "recipe[rbenv::user]"
  ]
}

upgrade設定をしたあとにcookすると正しくインストールできました。

knife solo cook {host_name}

参考

7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6