草庐IT

linux - Windows下无法运行Laravel Homestead(grep报错)

coder 2024-06-06 原文

我应该预先指出,我基本上是 Linux 文盲 - 我是 Windows 用户,我想尝试 Hack 语言,这似乎是启动和运行的最快方法。

我关注了this tutorial series并尝试启动配置的镜像。

当我运行 homestead uphomestead provision 时,它失败并显示相同的错误消息:

Rasmus Schultz@SIDEWINDER-7240 ~
$ homestead provision
==> default: Running provisioner: file...
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: grep: unrecognized option '---- BEGIN SSH2 PUBLIC KEY ----
==> default: Comment: "RasmusHomestead"
==> default: AAAAB3NzaC1yc2EAAAABJQAAAQEAhJ4eUnXFP7dCX98KtqNoZI9WwkE0+EBfuggt
...snip...
==> default: bVlGxJAHJd6u0vW9fssohiaUuo+8i48zHn8Ciqs5XVAn79m/PQ==
==> default: ---- END SSH2 PUBLIC KEY ----
==> default: '
==> default: Usage: grep [OPTION]... PATTERN [FILE]...
==> default: Try 'grep --help' for more information.
==> default: ---- BEGIN SSH2 PUBLIC KEY ---- Comment: "RasmusHomestead" AAAAB3NzaC1yc2EAAAABJQAAAQEAhJ4eUnXFP7dCX98KtqNoZI9WwkE0+EBfuggt 
...snip...
bVlGxJAHJd6u0vW9fssohiaUuo+8i48zHn8Ciqs5XVAn79m/PQ== ---- END SSH2 PUBLIC KEY ----
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: /tmp/vagrant-shell: line 1: /home/vagrant/.ssh/$2: ambiguous redirect
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

我已经尝试更新 Composer、Homestead、Vagrant、VirtualBox、Homestead box 图像,我能想到的一切 - 我很确定它们都是最新的。

Rasmus Schultz@SIDEWINDER-7240 ~
$ homestead
Laravel Homestead version 2.0.17

Rasmus Schultz@SIDEWINDER-7240 ~
$ homestead update
==> default: Checking for updates to 'laravel/homestead'
    default: Latest installed version: 0.2.6
    default: Version constraints:
    default: Provider: virtualbox
==> default: Box 'laravel/homestead' (v0.2.6) is running the latest version.

Rasmus Schultz@SIDEWINDER-7240 ~
$ composer global update laravel/homestead
Changed current directory to C:/Users/Rasmus Schultz/AppData/Roaming/Composer
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files

这是我的 Homestead.yaml 文件:

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: C:\Users\Rasmus Schultz\.ssh\RasmusHomestead.pub

keys:
    - C:\Users\Rasmus Schultz\.ssh\RasmusHomestead

folders:
    - map: C:\workspace
      to: /home/vagrant/Code

sites:
    - map: test.dev
      to: /home/vagrant/Code/test
      hhvm: true

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

这个 grep 错误看起来像是在配置框内发生的内部问题 - 好像发出的 grep 命令无效?

什么给了?

更新:

好的,第一个问题已经解决了 - 它期待一个不同的 key 格式,但这并没有修复“模糊重定向”错误消息......假设我必须重新配置?我关闭了 vagrant 并重新启动它,没有运气。

$ homestead provision
==> default: Running provisioner: file...
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: /tmp/vagrant-shell: line 1: /home/vagrant/.ssh/$2: ambiguous redirect
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

最佳答案

出现 grep 错误是因为它不喜欢用于公钥的默认 putty 格式。您需要将其重新保存为 OpenSSH key 。

这可以通过在 Putty Key Generator 中重新打开私钥文件,然后将公钥(位于顶部标记为“Public key for pasteing into OpenSSH authorized_keys file”)复制/粘贴到一个 key 文件(一个新的一个或您现有的一个)。

如果您选择将其保存为新文件,那么您需要在您的宅基地配置文件中调整路径。

关于linux - Windows下无法运行Laravel Homestead(grep报错),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30072927/

有关linux - Windows下无法运行Laravel Homestead(grep报错)的更多相关文章

  1. ruby - 如何从 ruby​​ 中的字符串运行任意对象方法? - 2

    总的来说,我对ruby​​还比较陌生,我正在为我正在创建的对象编写一些rspec测试用例。许多测试用例都非常基础,我只是想确保正确填充和返回值。我想知道是否有办法使用循环结构来执行此操作。不必为我要测试的每个方法都设置一个assertEquals。例如:describeitem,"TestingtheItem"doit"willhaveanullvaluetostart"doitem=Item.new#HereIcoulddotheitem.name.shouldbe_nil#thenIcoulddoitem.category.shouldbe_nilendend但我想要一些方法来使用

  2. ruby - 在 Ruby 程序执行时阻止 Windows 7 PC 进入休眠状态 - 2

    我需要在客户计算机上运行Ruby应用程序。通常需要几天才能完成(复制大备份文件)。问题是如果启用sleep,它会中断应用程序。否则,计算机将持续运行数周,直到我下次访问为止。有什么方法可以防止执行期间休眠并让Windows在执行后休眠吗?欢迎任何疯狂的想法;-) 最佳答案 Here建议使用SetThreadExecutionStateWinAPI函数,使应用程序能够通知系统它正在使用中,从而防止系统在应用程序运行时进入休眠状态或关闭显示。像这样的东西:require'Win32API'ES_AWAYMODE_REQUIRED=0x0

  3. ruby-on-rails - 由于 "wkhtmltopdf",PDFKIT 显然无法正常工作 - 2

    我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-

  4. ruby - 如何每月在 Heroku 运行一次 Scheduler 插件? - 2

    在选择我想要运行操作的频率时,唯一的选项是“每天”、“每小时”和“每10分钟”。谢谢!我想为我的Rails3.1应用程序运行调度程序。 最佳答案 这不是一个优雅的解决方案,但您可以安排它每天运行,并在实际开始工作之前检查日期是否为当月的第一天。 关于ruby-如何每月在Heroku运行一次Scheduler插件?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/8692687/

  5. ruby-on-rails - 无法使用 Rails 3.2 创建插件? - 2

    我对最新版本的Rails有疑问。我创建了一个新应用程序(railsnewMyProject),但我没有脚本/生成,只有脚本/rails,当我输入ruby./script/railsgeneratepluginmy_plugin"Couldnotfindgeneratorplugin.".你知道如何生成插件模板吗?没有这个命令可以创建插件吗?PS:我正在使用Rails3.2.1和ruby​​1.8.7[universal-darwin11.0] 最佳答案 随着Rails3.2.0的发布,插件生成器已经被移除。查看变更日志here.现在

  6. ruby-on-rails - 如何在 ruby​​ 中使用两个参数异步运行 exe? - 2

    exe应该在我打开页面时运行。异步进程需要运行。有什么方法可以在ruby​​中使用两个参数异步运行exe吗?我已经尝试过ruby​​命令-system()、exec()但它正在等待过程完成。我需要用参数启动exe,无需等待进程完成是否有任何ruby​​gems会支持我的问题? 最佳答案 您可以使用Process.spawn和Process.wait2:pid=Process.spawn'your.exe','--option'#Later...pid,status=Process.wait2pid您的程序将作为解释器的子进程执行。除

  7. ruby - 无法运行 Rails 2.x 应用程序 - 2

    我尝试运行2.x应用程序。我使用rvm并为此应用程序设置其他版本的ruby​​:$rvmuseree-1.8.7-head我尝试运行服务器,然后出现很多错误:$script/serverNOTE:Gem.source_indexisdeprecated,useSpecification.Itwillberemovedonorafter2011-11-01.Gem.source_indexcalledfrom/Users/serg/rails_projects_terminal/work_proj/spohelp/config/../vendor/rails/railties/lib/r

  8. ruby-on-rails - 无法在centos上安装therubyracer(V8和GCC出错) - 2

    我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e

  9. ruby - 无法让 RSpec 工作—— 'require' : cannot load such file - 2

    我花了三天的时间用头撞墙,试图弄清楚为什么简单的“rake”不能通过我的规范文件。如果您遇到这种情况:任何文件夹路径中都不要有空格!。严重地。事实上,从现在开始,您命名的任何内容都没有空格。这是我的控制台输出:(在/Users/*****/Desktop/LearningRuby/learn_ruby)$rake/Users/*******/Desktop/LearningRuby/learn_ruby/00_hello/hello_spec.rb:116:in`require':cannotloadsuchfile--hello(LoadError) 最佳

  10. ruby - Sinatra:运行 rspec 测试时记录噪音 - 2

    Sinatra新手;我正在运行一些rspec测试,但在日志中收到了一堆不需要的噪音。如何消除日志中过多的噪音?我仔细检查了环境是否设置为:test,这意味着记录器级别应设置为WARN而不是DEBUG。spec_helper:require"./app"require"sinatra"require"rspec"require"rack/test"require"database_cleaner"require"factory_girl"set:environment,:testFactoryGirl.definition_file_paths=%w{./factories./test/

随机推荐