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

質問編集履歴

2

```で囲みました。vagrantfileを追加いたしました

2020/04/26 05:18

投稿

hikky2020
hikky2020

スコア0

title CHANGED
File without changes
body CHANGED
@@ -3,7 +3,7 @@
3
3
  ここに質問の内容を詳しく書いてください。
4
4
  vagrant up を実行したいのですが上手くいかない 初心者なのでどうすればいいかわからず固まっています。よろしくお願いします
5
5
  ### 発生している問題・エラーメッセージ
6
- /Users/tomoriakira/.zshrc:export:4: not valid in this context: export PATH
6
+ ```/Users/tomoriakira/.zshrc:export:4: not valid in this context: export PATH
7
7
  tomoriakira@tomoriakiranoMacBook-Air ~ % cd ~\vagrant\ubuntu64_18
8
8
  zsh: no such user or named directory: vagrantubuntu64_18
9
9
  tomoriakira@tomoriakiranoMacBook-Air ~ % mkdir -p ~/vagrant/ubuntu64_18
@@ -19,8 +19,79 @@
19
19
  Path: /Users/tomoriakira/vagrant/ubuntu64_18/Vagrantfile
20
20
  Line number: 0
21
21
  Message: undefined local variable or method ` config'
22
- tomoriakira@tomoriakiranoMacBook-Air ubuntu64_18 %
22
+ tomoriakira@tomoriakiranoMacBook-Air ubuntu64_18 %```
23
23
 
24
+ vagrantfileの中身
25
+ ```# -*- mode: ruby -*-
26
+ # vi: set ft=ruby :
27
+
28
+ # All Vagrant configuration is done below. The "2" in Vagrant.configure
29
+ # configures the configuration version (we support older styles for
30
+ # backwards compatibility). Please don't change it unless you know what
31
+ # you're doing.
32
+ Vagrant.configure("2") do |config|
33
+ # The most common configuration options are documented and commented below.
34
+ # For a complete reference, please see the online documentation at
35
+ # https://docs.vagrantup.com.
36
+
37
+ # Every Vagrant development environment requires a box. You can search for
38
+ # boxes at https://vagrantcloud.com/search.
39
+ config.vm.box = "ubuntu/bionic64"
40
+
41
+ # Disable automatic box update checking. If you disable this, then
42
+ # boxes will only be checked for updates when the user runs
43
+ # `vagrant box outdated`. This is not recommended.
44
+ # config.vm.box_check_update = false
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. In the example below,
48
+ # accessing "localhost:8080" will access port 80 on the guest machine.
49
+ # NOTE: This will enable public access to the opened port
50
+ # config.vm.network "forwarded_port", guest: 80, host: 8080
51
+  config.vm.network "forwarded_port", guest: 8000, host: 8000
52
+ # Create a forwarded port mapping which allows access to a specific port
53
+ # within the machine from a port on the host machine and only allow access
54
+ # via 127.0.0.1 to disable public access
55
+ # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
56
+
57
+ # Create a private network, which allows host-only access to the machine
58
+ # using a specific IP.
59
+ # config.vm.network "private_network", ip: "192.168.33.10"
60
+
61
+ # Create a public network, which generally matched to bridged network.
62
+ # Bridged networks make the machine appear as another physical device on
63
+ # your network.
64
+ # config.vm.network "public_network"
65
+
66
+ # Share an additional folder to the guest VM. The first argument is
67
+ # the path on the host to the actual folder. The second argument is
68
+ # the path on the guest to mount the folder. And the optional third
69
+ # argument is a set of non-required options.
70
+ # config.vm.synced_folder "../data", "/vagrant_data"
71
+ config.vm.synced_folder "./workspace", "/home/vagrant/workspace"
72
+ # Provider-specific configuration so you can fine-tune various
73
+ # backing providers for Vagrant. These expose provider-specific options.
74
+ # Example for VirtualBox:
75
+ #
76
+ config.vm.provider "virtualbox" do |vb|
77
+ # # Display the VirtualBox GUI when booting the machine
78
+ # vb.gui = true
79
+ #
80
+ # # Customize the amount of memory on the VM:
81
+ vb.memory = "1024"
82
+ end
83
+ #
84
+ # View the documentation for the provider you are using for more
85
+ # information on available options.
86
+
87
+ # Enable provisioning with a shell script. Additional provisioners such as
88
+ # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
89
+ # documentation for more information about their specific syntax and use.
90
+ # config.vm.provision "shell", inline: <<-SHELL
91
+ # apt-get update
92
+ # apt-get install -y apache2
93
+ # SHELL
94
+ end```
24
95
  ```### 該当のソースコード
25
96
 
26
97
  ```ここに言語名を入力

1

全体をコピペしました。

2020/04/26 05:18

投稿

hikky2020
hikky2020

スコア0

title CHANGED
File without changes
body CHANGED
@@ -3,20 +3,25 @@
3
3
  ここに質問の内容を詳しく書いてください。
4
4
  vagrant up を実行したいのですが上手くいかない 初心者なのでどうすればいいかわからず固まっています。よろしくお願いします
5
5
  ### 発生している問題・エラーメッセージ
6
+ /Users/tomoriakira/.zshrc:export:4: not valid in this context: export PATH
7
+ tomoriakira@tomoriakiranoMacBook-Air ~ % cd ~\vagrant\ubuntu64_18
8
+ zsh: no such user or named directory: vagrantubuntu64_18
9
+ tomoriakira@tomoriakiranoMacBook-Air ~ % mkdir -p ~/vagrant/ubuntu64_18
10
+ tomoriakira@tomoriakiranoMacBook-Air ~ % cd ~/vagrant/ubuntu64_18
6
11
 
7
- ユーザー名:ubuntu64_18 ユーザー名$ vagrant up
12
+ tomoriakira@tomoriakiranoMacBook-Air ubuntu64_18 % vagrant up
8
13
  Vagrant failed to initialize at a very early stage:
9
14
 
10
15
  There was an error loading a Vagrantfile. The file being loaded
11
16
  and the error message are shown below. This is usually caused by
12
17
  an invalid or undefined variable.
13
18
 
14
- Path: /Users/ユーザー名/vagrant/ubuntu64_18/Vagrantfile
19
+ Path: /Users/tomoriakira/vagrant/ubuntu64_18/Vagrantfile
15
20
  Line number: 0
16
21
  Message: undefined local variable or method ` config'
17
- ```
22
+ tomoriakira@tomoriakiranoMacBook-Air ubuntu64_18 %
18
23
 
19
- ### 該当のソースコード
24
+ ```### 該当のソースコード
20
25
 
21
26
  ```ここに言語名を入力
22
27
  ソースコード