gpt4 book ai didi

windows - 使用记录的 cro 命令行工具时遇到问题

转载 作者:可可西里 更新时间:2023-11-01 12:43:29 24 4
gpt4 key购买 nike

我在 Windows 7 上运行 Rakudo Star 2019.03.1,Cro 由 zef 安装。关注Getting Started关于 Cro website 的部分,以下应该有效:

The cro stub command generates stub services for you, to get started more quickly and with better defaults. Here we use it to create a simple HTTP service, with ID hello and in the hello directory:

cro stub http hello hello

...这确实有效,它为项目生成了很多文件,包括 .cro.yml 文件,我认为它是服务的中心描述文件。但是,如果我尝试按照文档运行 cro run(我假设是从 hello 目录中运行):

The cro run command will start your service (and automatically restart the service if you change a file):

cro run

...服务未启动但 cro 错误:

A react block:
in sub run-services at C:\rakudo\share\perl6\site\sources\709F4B18755ADE6922C88B8C44A0930A5DDD77C9 (Cro::Tools::CLI) line 227
in sub MAIN at C:\rakudo\share\perl6\site\sources\709F4B18755ADE6922C88B8C44A0930A5DDD77C9 (Cro::Tools::CLI) line 199
in block <unit> at C:\rakudo\share\perl6\site\resources\C1E87B0F084684C12CD87240AE4C12E746174570 line 1
in sub MAIN at C:\rakudo\share\perl6\site\bin\cro line 3
in block <unit> at C:\rakudo\share\perl6\site\bin\cro line 1

Died because of the exception:
no such file or directory
in any at C:\rakudo\share/perl6/runtime/CORE.d.setting.moarvm line 1
in sub run-services at C:\rakudo\share\perl6\site\sources\709F4B18755ADE6922C88B8C44A0930A5DDD77C9 (Cro::Tools::CLI) line 227
in sub MAIN at C:\rakudo\share\perl6\site\sources\709F4B18755ADE6922C88B8C44A0930A5DDD77C9 (Cro::Tools::CLI) line 199
in block <unit> at C:\rakudo\share\perl6\site\resources\C1E87B0F084684C12CD87240AE4C12E746174570 line 1
in sub MAIN at C:\rakudo\share\perl6\site\bin\cro line 3
in block <unit> at C:\rakudo\share\perl6\site\bin\cro line 1

不幸的是,这条错误信息不是对我说的。我想念什么?

最佳答案

更新

不知何故我错过了这个Cro github issue昨天谷歌搜索时,这正是我的问题所在。我在 github 问题中反向链接了这个问题+答案。 fix has since been merged并将成为 Cro 下一个版本的一部分。支持大家快速响应!


原始答案

这可以在 timotimo 的帮助下解决(谢谢!),谁

  • 建议 Cro::Tools::Runner 调用 perl6 而不是需要的 perl6.bat适用于 Windows。
  • 指出我 this answer其中包含有关更改 zef 安装模块中代码的重要信息。

所以我前往 %USERPROFILE%\.zef\store\cro-0.8.1.tar.gz\cro-0.8.1\lib\Cro\Tools 并修补了可执行名称在 Runner.pm6 的第 269 行。然后我返回到 %USERPROFILE%\.zef\store\cro-0.8.1.tar.gz\cro-0.8.1 并使用以下命令重新编译并安装模块(注意--/test 跳过测试,这会花费很多时间):

C:\...\.zef\store\cro-0.8.1.tar.gz\cro-0.8.1>zef install . --force-install --/test --verbose
The following local path candidates are already installed: .
===> Installing: cro:ver<0.8.1>
===> Install [OK] for cro:ver<0.8.1>

1 bin/ script [cro] installed to:
C:\rakudo\share\perl6\site\bin

现在,cro run 向我喷出我认为是 ANSI 代码的内容,但它正在运行 :)

C:\ws\perl6\hello>cro run
←[1;32mÔûÂ Starting hello (hello)←[0m
←[32m­ƒöî Endpoint HTTP will be at http://localhost:20000/←[0m
←[32m­ƒôô hello ←[0mListening at http://localhost:20000

关于windows - 使用记录的 cro 命令行工具时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57047921/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com