Laravel 4队列-[InvalidArgumentException]在"queue"队列中没有定义任何命令.命名空间 [英] Laravel 4 Queue - [InvalidArgumentException] There are no commands defined in the "queue" namespace

查看:675
本文介绍了Laravel 4队列-[InvalidArgumentException]在"queue"队列中没有定义任何命令.命名空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在CentOS 6 VPS上使用Laravel 4 + Beanstalk + Supervisor.

I'm using Laravel 4 + Beanstalk + Supervisor on a CentOS 6 VPS.

在VPS上同时安装beantalk和超级用户已经很辛苦,但我还是成功地做到了(我已经在本地服务器Macbook Pro上完成了同样的安装,并且在这里工作正常).

It was already a pain to install both beanstalk and supervisor on the VPS, but I got through it (I have done this same installation on my local server, a Macbook Pro, and it's working fine there).

我想利用Laravel 4的Queues和Beanstalk异步发送电子邮件.我为主管创建了一个程序",基本上可以运行命令

I want to take advantage of Laravel 4's Queues and Beanstalk to send email asynchronously. I have made a "program" for supervisor that basically runs the command

php artisan queue:listen --env=production

,但是与此相关的过程无法成功启动.我为此过程定义的日志输出以下内容:

but the process associated to that won't start succesfully. The log I defined for this process outputs the following:

[InvalidArgumentException]
There are no commands defined in the "queue" namespace.

显然,工匠正在发现根本不喜欢的东西.

So apparently artisan is finding something that it doesn't like at all.

请,请,您能帮我吗?只有我在Google上找到的结果是未答复 git问题帖子,并且是同样没用的主题,在Laravel的论坛上也没有答案.

Please, please, PLEASE, would you help me? Only results I've found on Google are an unanswered git issue post, and an equally useless thread with no answers on Laravel's forums.

编辑:测试我注意到Artisan的queue:listen在shell中由我运行时工作正常,但是当Supervisord尝试运行命令时,发生InvalidArgumentException.

Edit: Testing I've noticed that Artisan's queue:listen works fine when run by me in the shell, but when Supervisord tries to run the command, the InvalidArgumentException happens.

推荐答案

就我而言,如果您遇到任何问题,解决方案如下:

The solution in my case, if any one of you ever come across this issue, was the following:

我安装了主管版本2.1(通过pip).我至少需要版本3.0(因为在版本3.0中引入了目录"设置(在supervisord.conf文件中使用).

I had supervisord version 2.1 installed (via pip). I needed at least version 3.0 (because the "directory" setting (used in the supervisord.conf file) was introduced in the version 3.0.

我必须

pip uninstall supervisor

那我不得不

pip install supervisor==3.0

在那之后,我只需要在/etc/supervisord.conf中设置所需的配置值,并且我的artisan在运行queue:listen时就没有问题.

After that, I just had to set the desired configuration values in /etc/supervisord.conf, and my artisan was running queue:listen without problems.

这篇关于Laravel 4队列-[InvalidArgumentException]在"queue"队列中没有定义任何命令.命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆