Vagrant up不起作用

时间:2016-01-31 19:11:03

标签: laravel ssh vagrant virtualbox homestead

当我跑'流浪汉'时,我遇到了错误。我什么都不知道。以前我运行没有错误。我卖了SSD Harddisk并拿走了它。当我想再次安装时,遇到了这个错误。

/Users/KerimCaglar/sites/Homestead/scripts/homestead.rb:106:in `read': No such file or directory @ rb_sysopen - /Users/KerimCaglar/KerimCaglar/.ssh/id_rsa (Errno::ENOENT)
from /Users/KerimCaglar/sites/Homestead/scripts/homestead.rb:106:in `block (2 levels) in configure'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/kernel_v2/config/vm_provisioner.rb:72:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/kernel_v2/config/vm_provisioner.rb:72:in `add_config'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/kernel_v2/config/vm.rb:321:in `provision'
from /Users/KerimCaglar/sites/Homestead/scripts/homestead.rb:103:in `block in configure'
from /Users/KerimCaglar/sites/Homestead/scripts/homestead.rb:102:in `each'
from /Users/KerimCaglar/sites/Homestead/scripts/homestead.rb:102:in `configure'
from /Users/KerimCaglar/sites/Homestead/Vagrantfile:20:in `block in <top (required)>'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/v2/loader.rb:37:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/v2/loader.rb:37:in `load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:113:in `block (2 levels) in load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:107:in `each'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:107:in `block in load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:104:in `each'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:104:in `load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/vagrantfile.rb:28:in `initialize'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:740:in `new'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:740:in `vagrantfile'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:486:in `host'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:208:in `block in action_runner'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:33:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:33:in `run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:473:in `hook'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:722:in `unload'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/bin/vagrant:177:in `ensure in <main>'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/bin/vagrant:177:in `<main>'

3 个答案:

答案 0 :(得分:22)

该错误的重要部分在于:

  

没有这样的文件或目录@ rb_sysopen - /Users/KerimCaglar/KerimCaglar/.ssh/id_rsa

您尚未生成SSH密钥,或者需要指定正确的路径。

如果查看Homestead.yaml文件,您应该会看到ssh密钥的路径:

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

如果您的SSH密钥位于其他位置,则需要指定正确的路径。否则你需要生成它。

ssh-keygen -t rsa -C "your@email.com"

Source

答案 1 :(得分:2)

错误的关键部分是重复路径:

if

注意如何提及两次用户名。我发现这是由以下原因造成的:

  1. 在Vagrant文​​件中指定太多路径,例如

    config.vm.provision&#34; file&#34;,source:&#34; KerimCaglar / .ssh / id_rsa" ;, destination:&#34; .ssh / rd_rsa& #34;

  2. 您从子目录中调用/Users/KerimCaglar/KerimCaglar/.ssh/id_rsa (Errno::ENOENT) - vagrant up会修复它。

答案 2 :(得分:0)

如果你已经安装了Git,你只需要通过GUI生成你的ssh密钥。帮助 - &gt;显示密钥

enter image description here