teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

Vagrantファイルの中身の全容を追加しました

2020/06/19 01:54

投稿

shirout
shirout

スコア36

title CHANGED
File without changes
body CHANGED
@@ -14,5 +14,79 @@
14
14
  ```以下vagrant fileの内容になります!
15
15
  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
16
16
  ```
17
+
18
+ ```Vagrantファイルの中身の全容です
19
+ # -*- mode: ruby -*-
20
+ # vi: set ft=ruby :
21
+
22
+ # All Vagrant configuration is done below. The "2" in Vagrant.configure
23
+ # configures the configuration version (we support older styles for
24
+ # backwards compatibility). Please don't change it unless you know what
25
+ # you're doing.
26
+ Vagrant.configure("2") do |config|
27
+ # The most common configuration options are documented and commented below.
28
+ # For a complete reference, please see the online documentation at
29
+ # https://docs.vagrantup.com.
30
+
31
+ # Every Vagrant development environment requires a box. You can search for
32
+ # boxes at https://vagrantcloud.com/search.
33
+ config.vm.box = "fabric-fundamentals"
34
+
35
+ # Disable automatic box update checking. If you disable this, then
36
+ # boxes will only be checked for updates when the user runs
37
+ # `vagrant box outdated`. This is not recommended.
38
+ # config.vm.box_check_update = false
39
+
40
+ # Create a forwarded port mapping which allows access to a specific port
41
+ # within the machine from a port on the host machine. In the example below,
42
+ # accessing "localhost:8080" will access port 80 on the guest machine.
43
+ # NOTE: This will enable public access to the opened port
44
+ # config.vm.network "forwarded_port", guest: 80, host: 8080
45
+
46
+ # Create a forwarded port mapping which allows access to a specific port
47
+ # within the machine from a port on the host machine and only allow access
48
+ # via 127.0.0.1 to disable public access
49
+ # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
50
+
51
+ # Create a private network, which allows host-only access to the machine
52
+ # using a specific IP.
53
+ # config.vm.network "private_network", ip: "192.168.33.10"
54
+
55
+ # Create a public network, which generally matched to bridged network.
56
+ # Bridged networks make the machine appear as another physical device on
57
+ # your network.
58
+ # config.vm.network "public_network"
59
+
60
+ # Share an additional folder to the guest VM. The first argument is
61
+ # the path on the host to the actual folder. The second argument is
62
+ # the path on the guest to mount the folder. And the optional third
63
+ # argument is a set of non-required options.
64
+ # config.vm.synced_folder "../data", "/vagrant_data"
65
+
66
+ # Provider-specific configuration so you can fine-tune various
67
+ # backing providers for Vagrant. These expose provider-specific options.
68
+ # Example for VirtualBox:
69
+ #
70
+ # config.vm.provider "virtualbox" do |vb|
71
+ # # Display the VirtualBox GUI when booting the machine
72
+ # vb.gui = true
73
+ #
74
+ # # Customize the amount of memory on the VM:
75
+ # vb.memory = "1024"
76
+ # end
77
+ #
78
+ # View the documentation for the provider you are using for more
79
+ # information on available options.
80
+
81
+ # Enable provisioning with a shell script. Additional provisioners such as
82
+ # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
83
+ # documentation for more information about their specific syntax and use.
84
+ # config.vm.provision "shell", inline: <<-SHELL
85
+ # apt-get update
86
+ # apt-get install -y apache2
87
+ # SHELL
88
+ end
89
+ vagrant box add --name fabric-fundamentals fabric-fundamentals.box
90
+ ```
17
91
  VagrantのBOXの追加ができません。
18
92
  このようなエラーが出るのですが何が原因か分かる方いたらお願いします。

1

vagrant fileの内容追加

2020/06/19 01:54

投稿

shirout
shirout

スコア36

title CHANGED
File without changes
body CHANGED
@@ -11,6 +11,8 @@
11
11
  /Users/nag/ascii/Vagrantfile:71: syntax error, unexpected tIDENTIFIER, expecting do or '{' or '('
12
12
  ...name fabric-fundamentals fabric-fundamentals.box
13
13
  ```
14
-
14
+ ```以下vagrant fileの内容になります!
15
+ 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
16
+ ```
15
17
  VagrantのBOXの追加ができません。
16
18
  このようなエラーが出るのですが何が原因か分かる方いたらお願いします。