2018年1月14日日曜日

vagrant up できない

Can not Vagrant up.



ansibleの設定をいじっていて(php5→php7)、一旦 vagrant destory してから vagrant up するとエラーになり vagrant が立ち上がらない。。。

mac OS High Sierra ではいろいろあるそうなので vagrantをアップグレード


The box 'centos/7' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:

URL: ["https://atlas.hashicorp.com/centos/7"]

Error: 


$ vagrant -v
Vagrant 1.8.7

vagrantをアップグレード

$ vagrant -v

Vagrant 2.0.1

$ vagrant up
Vagrant failed to initialize at a very early stage:

The plugins failed to initialize correctly. This may be due to manual
modifications made within the Vagrant home directory. Vagrant can
attempt to automatically correct this issue by running:

  vagrant plugin repair

If Vagrant was recently updated, this error may be due to incompatible
versions of dependencies. To fix this problem please remove and re-install
all plugins. Vagrant can attempt to do this automatically by running:

  vagrant plugin expunge --reinstall

Or you may want to try updating the installed plugins to their latest
versions:

  vagrant plugin update


Error message given during initialization: Unable to resolve dependency: user requested 'sahara (> 0)'


$ vagrant plugin expunge --reinstall

This command permanently deletes all currently installed user plugins. It
should only be used when a repair command is unable to properly fix the
system.

Continue? [N]: y

All user installed plugins have been removed from this Vagrant environment!

Vagrant will now attempt to reinstall user plugins that were removed.
Installing the 'sahara' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

Unable to resolve dependency: user requested 'sahara (> 0)'
$ vagrant plugin expunge --reinstall

This command permanently deletes all currently installed user plugins. It
should only be used when a repair command is unable to properly fix the
system.

Continue? [N]: y

All user installed plugins have been removed from this Vagrant environment!


Vagrant will now attempt to reinstall user plugins that were removed.

vagrant up できた!

Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:

mount -t vboxsf -o uid=1000,gid=1000 vagrant /vagrant

The error output from the command was:


mount: unknown filesystem type 'vboxsf'

あれ?ファイル共有ができないみたい。
プラグインを削除したので再度プラグインをインストール!

$ vagrant plugin install vagrant-vbguest
Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
Fetching: vagrant-share-1.1.9.gem (100%)
Fetching: micromachine-2.0.0.gem (100%)
Fetching: vagrant-vbguest-0.15.1.gem (100%)

Installed the plugin 'vagrant-vbguest (0.15.1)'!

再度、vagrant up オーケー。ステータス確認

$ vagrant status
Current machine states:


default                   running (virtualbox)

vagrant ssh で phpのバージョンを確認っと

$ php -v
PHP 7.1.7 (cli) (built: Jul 15 2017 18:08:09) ( NTS )
Copyright (c) 1997-2017 The PHP Group

Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

php7成功!

ansible_local 便利!

ちなみに、ジェームス西風新都店なうw。
ドライブシャフトブーツ交換の待ち時間中に終わってよかった!車はまだ。。。
https://www.jms-car.com/shop/detail/41641.html