[Vagrant]導入時のエラー

スポンサーリンク

エラーその1

$ vagrant box add centos67 https://github.com/CommanderK5/packer-centos-template/releases/download/0.6.7/vagrant-centos-6.7.box
There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.
Path: /Users/User/work/1_d/Vagrantfile
Line number: 0
Message: NameError: uninitialized constant Dotenv

解決策

  • railsをインストールした
    リンク追加:
    https://blog.integrityworks.co.jp/2016/09/ruby-rails-version
     →直接の原因はわからないです。。。
      Dotenvがgemで使われる何かってことがわかったので、その辺りのインストール状況を確認し、Rubyのバージョンが古いことが原因かなと予測してやってみたら直りました。

エラーその2

$ vagrant box add centos67 https://github.com/CommanderK5/packer-centos-template/releases/download/0.6.7/vagrant-centos-6.7.box
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/environment.rb:85:in `pwd': No such file or directory - getcwd (Errno::ENOENT)
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/environment.rb:85:in `initialize'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/bin/vagrant:165:in `new'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/bin/vagrant:165:in `<main>'

解決策

  • 再起動(多分、rubyをインストールするときに環境変数を追加したけど、それが読めてなかったのだと思う。だから設定読み直しで大丈夫だと思う)

エラーその3

$ vagrant box add centos67 https://github.com/CommanderK5/packer-centos-template/releases/download/0.6.7/vagrant-centos-6.7.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'centos67' (v0) for provider:
    box: Downloading: https://github.com/CommanderK5/packer-centos-template/releases/download/0.6.7/vagrant-centos-6.7.box
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
SSL read: error:00000000:lib(0):func(0):reason(0), errno 60

解決策

  • 以下のコマンドで、古いtmpファイル(上でエラーだったときに残ったファイル類)を削除
    $ rm -rf ~/.vagrant.d/tmp/*

コメント

タイトルとURLをコピーしました