Mac
vagrant

Vagrant 1.8.7でvagrant upできないときの応急対応

More than 1 year has passed since last update.


環境

Mac OS X EI Capitan 10.11.6

Vagrant 1.8.7


現象

vagrant upでboxを取得するようにした状態で、upするとcurlで落ちる。

  config.vm.define 'api' do |api|

api.vm.box = 'api'
api.vm.box_url = 'https://s3-ap-northeast-1.amazonaws.com/path/to/api.json'

$ VAGRANT_LOG=debug vagrant up api

...
ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<Vagrant::Errors::DownloaderError: An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

>
ERROR vagrant: An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

ERROR vagrant: /opt/vagrant/embedded/gems/gems/vagrant-1.8.7/lib/vagrant/util/downloader.rb:206:in `execute_curl'
...


原因

$ /opt/vagrant/embedded/bin/curl --version

dyld: Library not loaded: @rpath/libcurl.4.dylib
Referenced from: /opt/vagrant/embedded/bin/curl
Reason: Incompatible library version: curl requires version 9.0.0 or later, but libcurl.4.dylib provides version 7.0.0

libcurlのバージョンが古いらしい。


応急対応

https://github.com/mitchellh/vagrant/issues/7969

$ sudo mv /opt/vagrant/embedded/bin/curl{,.bak} 

(rmするのも不安なのでmvにしておく)