$ vagrant box add --name fabric-fundamentals fabric-fundamentals.box
Vagrant failed to initialize at a very early stage:
There is a syntax error in the following Vagrantfile. The syntax error
message is reproduced below for convenience:
/Users/nag/ascii/Vagrantfile:71: syntax error, unexpected tIDENTIFIER, expecting do or '{' or '('
vagrant box add --name fabric-fundamentals fabric-fundamen...
^~~~~~
/Users/nag/ascii/Vagrantfile:71: syntax error, unexpected tIDENTIFIER, expecting do or '{' or '('
...name fabric-fundamentals fabric-fundamentals.box
vagrant box add --name fabric-fundamentals fabric-fundamentals.box3.Vagrant環境を起動するディレクトリへ移動します(先ほどダウンロードしたVagrantイメージ内に作成されています)。Vagrant環境は、必要なディレクトリ構造がすべて定義された仮想マシンであり、Vagrantをどこからでも実行できます。4.以下のコマンドを実行して、Vagrant環境を初期化します。vagrant init fabric-fundamentals現在のディレクトリに新規のVagrantfileが作成されます。このファイルに、プロジェクトが使用する仮想マシンの種類、また仮想マシンの構成方法とプロビジョニング方法が記述されています。このファイルは必要に応じて修正することができます。5.仮想マシン/boxを実行する準備ができましたので、以下を実行します。vagrant up6.数分後に、以下の確認メッセージが表示されます。==> default: Machine booted and ready!VMが正常に起動した合図です。vagrant upの実行中にエラーが発生した場合は、本講習に含まれるトラブルシューティングガイドを参照してください。7.これで、実行中のVagrant VMにログインするために、SSHを使用できるようになります。vagrant ssh次に、環境内にあるfabric-fundamentalsディレクトリへ移動します。cd ~/fabric-fundamentals
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "fabric-fundamentals"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine and only allow access
# via 127.0.0.1 to disable public access
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.
# Enable provisioning with a shell script. Additional provisioners such as
# Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# apt-get update
# apt-get install -y apache2
# SHELL
end
vagrant box add --name fabric-fundamentals fabric-fundamentals.box
VagrantのBOXの追加ができません。
このようなエラーが出るのですが何が原因か分かる方いたらお願いします。
-
気になる質問をクリップする
クリップした質問は、後からいつでもマイページで確認できます。
またクリップした質問に回答があった際、通知やメールを受け取ることができます。
クリップを取り消します
-
良い質問の評価を上げる
以下のような質問は評価を上げましょう
- 質問内容が明確
- 自分も答えを知りたい
- 質問者以外のユーザにも役立つ
評価が高い質問は、TOPページの「注目」タブのフィードに表示されやすくなります。
質問の評価を上げたことを取り消します
-
評価を下げられる数の上限に達しました
評価を下げることができません
- 1日5回まで評価を下げられます
- 1日に1ユーザに対して2回まで評価を下げられます
質問の評価を下げる
teratailでは下記のような質問を「具体的に困っていることがない質問」、「サイトポリシーに違反する質問」と定義し、推奨していません。
- プログラミングに関係のない質問
- やってほしいことだけを記載した丸投げの質問
- 問題・課題が含まれていない質問
- 意図的に内容が抹消された質問
- 過去に投稿した質問と同じ内容の質問
- 広告と受け取られるような投稿
評価が下がると、TOPページの「アクティブ」「注目」タブのフィードに表示されにくくなります。
質問の評価を下げたことを取り消します
この機能は開放されていません
評価を下げる条件を満たしてません
質問の評価を下げる機能の利用条件
この機能を利用するためには、以下の事項を行う必要があります。
- 質問回答など一定の行動
-
メールアドレスの認証
メールアドレスの認証
-
質問評価に関するヘルプページの閲覧
質問評価に関するヘルプページの閲覧
checkベストアンサー
0
実は、今はvagrant box add
が使えません!
使うなら、vagrant init bento/centos-6.8
を使ってください!(CentOSだったら)
投稿
-
回答の評価を上げる
以下のような回答は評価を上げましょう
- 正しい回答
- わかりやすい回答
- ためになる回答
評価が高い回答ほどページの上位に表示されます。
-
回答の評価を下げる
下記のような回答は推奨されていません。
- 間違っている回答
- 質問の回答になっていない投稿
- スパムや攻撃的な表現を用いた投稿
評価を下げる際はその理由を明確に伝え、適切な回答に修正してもらいましょう。
15分調べてもわからないことは、teratailで質問しよう!
- ただいまの回答率 88.36%
- 質問をまとめることで、思考を整理して素早く解決
- テンプレート機能で、簡単に質問をまとめられる
質問への追記・修正、ベストアンサー選択の依頼
kazto
2020/06/18 17:14
Vagrantfileの内容を追記お願いします。コメント欄に記載するのではなく、質問を編集するかたちでお願いします。
kazto
2020/06/18 18:39
このVagrantfileはどうやって作成しましたか?少なくとも、Vagrantfileとしての書式を全く満たしていません。
shirout
2020/06/19 10:55
すみません、いつもありがとうございます。
中身の全容を追記しましたがこれも書式を満たしていないですか?
kazto
2020/06/19 23:11
最後の一行、不要です。