perl - 尝试运行任何命令行命令时未找到 Mojolicious-lite 命令错误
问题描述
我自己创建了 mojolicious-lite 应用程序(只是手动创建了我需要的文件,而不是使用“创建应用程序”命令)。我正在跟随这里的教程:https ://www.perl.com/article/193/2015/9/18/How-to-send-verification-emails-using-Mojolicious/
尝试在我的应用程序中使用任何命令行命令时,我遇到了错误。从本教程中,我特别想运行:
./hello.pl minion job
但更一般地说,我也注意到似乎没有命令对我有用,例如:
./hello.pl help
./hello.pl routes
错误似乎与解析我的 postgres 助手有关?这是确切的错误消息:
./hello.pl help
./hello.pl: line 1: use: command not found
./hello.pl: line 2: use: command not found
./hello.pl: line 3: use: command not found
./hello.pl: line 4: use: command not found
./hello.pl: line 5: use: command not found
./hello.pl: line 6: use: command not found
./hello.pl: line 7: use: command not found
./hello.pl: line 10: syntax error near unexpected token `('
./hello.pl: line 10: `helper pg => sub { state $pg = Mojo::Pg->new('postgresql://postgres@/test_users') };'
除了从命令行调用命令外,我的应用程序运行良好。
这是我的应用程序的前 11 行:
use Mojolicious::Lite;
use Mojo::ByteStream;
use Mojo::JWT;
use Mojo::Pg;
use Mojolicious::Plugin::Bcrypt;
use Mojolicious::Plugin::Minion;
use Data::Dumper;
helper pg => sub { state $pg = Mojo::Pg->new('postgresql://postgres@/test_users') };
app->pg->migrations->from_data->migrate;
解决方案
推荐阅读
- php - 来自谷歌字体的印地语字体在带有elfinder的cakephp中集成的tinymce编辑器中不起作用
- c++ - 将 double 添加到 long long 时的 C++ 精度错误
- windows - 管道输出到由 [Diagnostics.Process]::Start 启动的 Windows 可执行文件?
- php - 显示 systemctl 服务状态的 PHP 函数
- python - 如何将整数转换为base58?
- oracle - 尝试比较数字时出现 PLS-00103 错误
- javascript - 如何从包含的 Java 依赖项访问本机功能
- linux - bash中的十六进制到十进制转换
- c# - 更新 ZipArchive 中的文件
- prolog - Prolog上的递归谓词问题