LoginSignup
2
2

More than 5 years have passed since last update.

vagrant-1.2.1@Linuxでbox add出来ない問題の対処

Last updated at Posted at 2013-04-18

vagrantの1.1以降はgemではなくパッケージインストールの形になったようなのでとりあえず最新の1.2.1をインストールしてみた。

vagrant box add がエラーになる

早速適当なboxを動かsしてみようと思ったんだが、何故かbox addしようとすると↓のようなエラーが出てbox addが出来ない…。

# vagrant box add ce6 http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130309.box
Downloading or copying the box...
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Failed initialization

ちなみにMacのvagrant-1.2.1は問題なく動いたのになぁ…。

適当パッチ

で色々追ってみたらどうやら curl の起動に失敗しているようだ。PATHがどこでどうなって駄目な感じになったのかは追ってないが、とりあえず以下のように修正したら直った。

# diff -r /opt/vagrant/embedded/gems/gems/vagrant-1.2.1/lib/vagrant/util/downloader.rb.orig  /opt/vagrant/embedded/gems/gems/vagrant-1.2.1/lib/vagrant/util/downloader.rb
122c122
<           Subprocess.execute("curl", *options, &data_proc)
---
>           Subprocess.execute("/usr/bin/curl", *options, &data_proc)
2
2
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
2
2