Drukowana wersja tematu

Kliknij tu, aby zobaczyć temat w orginalnym formacie

Forum PHP.pl _ Kontrola i zarządzanie projektami _ Vagrant - początki nauki

Napisany przez: trzczy 7.04.2018, 04:15:27

Muszę uruchomić vagranta (nie dockera). Mam błąd:



  1. m@my:~/Desktop/MV$ vagrant up
  2. Bringing machine 'default' up with 'virtualbox' provider...
  3. ==> default: Checking if box 'peterrehm/xenial-php71' is up to http://www.php.net/date...
  4. ==> default: Clearing any previously set forwarded ports...
  5. ==> default: Clearing any previously set network interfaces...
  6. ==> default: Preparing network interfaces based on configuration...
  7. default: Adapter 1: nat
  8. ==> default: Forwarding ports...
  9. default: 22 (guest) => 2222 (host) (adapter 1)
  10. ==> default: Booting VM...
  11. ==> default: Waiting for machine to boot. This may take a few minutes...
  12. default: SSH address: 127.0.0.1:2222
  13. default: SSH username: vagrant
  14. default: SSH auth method: private http://www.php.net/key
  15. Timed out while waiting for the machine to boot. This means that
  16. Vagrant was unable to communicate with the guest machine within
  17. the configured ("config.vm.boot_timeout" value) http://www.php.net/time period.
  18.  
  19. If you look above, you should be able to see the error(s) that
  20. Vagrant had when attempting to connect to the machine. These errors
  21. are usually good hints as to what may be wrong.
  22.  
  23. If you're using a custom box, make sure that networking is properly
  24. working and you're able to connect to the machine. It is a common
  25. problem that networking isn't setup properly in these boxes.
  26. Verify that authentication configurations are also setup properly,
  27. as well.
  28.  
  29. If the box appears to be booting properly, you may want to increase
  30. the timeout ("config.vm.boot_timeout") value.
  31. m@my:~/Desktop/MV$ vagrant init peterrehm/xenial-php71


Nie wiem jak zmienić limit:
Vagrantfile:
  1. (...) # documentation for more information about their specific syntax and use.
  2. # config.vm.provision "shell", inline: <<-SHELL
  3. # apt-get update
  4. # apt-get install -y apache2
  5. # SHELL
  6. http://www.php.net/end
  7.  
  8.  
  9. config.vm.boot_timeout 1000
  10.  


  1. m@my:~/Desktop/MV$ vagrant up
  2. There was an error loading a Vagrantfile. The http://www.php.net/file being loaded
  3. and the error message are shown below. This is usually caused by
  4. a syntax error.
  5.  
  6. Path: /home/m/Desktop/MV/Vagrantfile
  7. Line number: 73
  8. Message: NameError: undefined local variable or method `config' for main:Object
  9. m@my:~/Desktop/MV$


Co radzicie?
Z góry dziękuję

Napisany przez: Pyton_000 7.04.2018, 07:38:21

wstaw przed `end`

Napisany przez: trzczy 7.04.2018, 09:56:29

Cytat(Pyton_000 @ 7.04.2018, 08:38:21 ) *
wstaw przed `end`

Na to już wpadłem, ale nie mogłem edytować postu, bo się robiła kaszana z postu. Jakiś bug foralny.

Udało mi się uruchomić. Wcześniej zrobiłem to:
  1. m@my:~/Desktop/VM$ sudo apt install virtualbox virtualbox-ext-http://www.php.net/pack


No i potem tak:


  1. m@my:~/Desktop/VM$ cat Vagrantfile; vagrant up
  2. Vagrant.configure("2") do |config|
  3. config.vm.box = "peterrehm/xenial-php71"
  4. config.vm.boot_timeout = 1000
  5. config.vm.provider "virtualbox" do |vb|
  6. vb.gui = true
  7. http://www.php.net/end
  8. http://www.php.net/end
  9. Bringing machine 'default' up with 'virtualbox' provider...
  10. ==> default: Checking if box 'peterrehm/xenial-php71' is up to http://www.php.net/date...
  11. ==> default: Clearing any previously set forwarded ports...
  12. ==> default: Clearing any previously set network interfaces...
  13. ==> default: Preparing network interfaces based on configuration...
  14. default: Adapter 1: nat
  15. ==> default: Forwarding ports...
  16. default: 22 (guest) => 2222 (host) (adapter 1)
  17. ==> default: Booting VM...
  18. ==> default: Waiting for machine to boot. This may take a few minutes...
  19. default: SSH address: 127.0.0.1:2222
  20. default: SSH username: vagrant
  21. default: SSH auth method: private http://www.php.net/key
  22. default: Warning: Connection http://www.php.net/reset. Retrying...
  23. default: Warning: Remote connection disconnect. Retrying...
  24. default: Warning: Connection http://www.php.net/reset. Retrying...
  25. default: Warning: Remote connection disconnect. Retrying...
  26. ==> default: Machine booted and ready!
  27. ==> default: Checking for guest additions in VM...
  28. ==> default: Mounting shared folders...
  29. default: /vagrant => /home/m/Desktop/VM
  30. ==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
  31. ==> default: flag to force provisioning. Provisioners marked to run always will still run.
  32. m@my:~/Desktop/VM$

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)