Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何设置Rails 4、Resque 2与Foreman一起运行?_Ruby On Rails_Ruby_Heroku_Resque_Foreman - Fatal编程技术网

Ruby on rails 如何设置Rails 4、Resque 2与Foreman一起运行?

Ruby on rails 如何设置Rails 4、Resque 2与Foreman一起运行?,ruby-on-rails,ruby,heroku,resque,foreman,Ruby On Rails,Ruby,Heroku,Resque,Foreman,我正在尝试在Heroku上运行一个简单的Rails应用程序,并执行一些后台任务 该应用程序被部署到Heroku,因此我在本地与Foreman一起运行它,以便类似于它在生产中的工作方式 然而,我无法让Resque启动并保持状态。它每次都会关闭,即使没有提交任何任务 事情就是这样安排的 Gemfile(基于github页面进行resque) Procfile gem "resque", "~> 2.0.0.pre.1", github: "resque/resque" web: bundle

我正在尝试在Heroku上运行一个简单的Rails应用程序,并执行一些后台任务

该应用程序被部署到Heroku,因此我在本地与Foreman一起运行它,以便类似于它在生产中的工作方式

然而,我无法让Resque启动并保持状态。它每次都会关闭,即使没有提交任何任务

事情就是这样安排的

Gemfile(基于github页面进行resque)

Procfile

gem "resque", "~> 2.0.0.pre.1", github: "resque/resque"
web: bundle exec rails server -e $RAILS_ENV -p $PORT
resque: bundle exec rake environment resque:work
当我运行'foreman start-e config/dev.env'时,所有东西都开始启动,但随后重新设置SIGTERMS。以下是日志:

16:26:56 resque.1 | Loading Rails environment for Resque
16:26:56 resque.1 | D, [2014-03-12T16:26:56.237941 #22530] DEBUG -- : resque-2.0.0.pre.1: Starting
16:26:56 resque.1 | exited with code 0
16:26:56 system   | sending SIGTERM to all processes
SIGTERM received
16:26:56 web.1    | [2014-03-12 16:26:56] FATAL SignalException: SIGTERM
您可以看到Resque正在启动,然后关闭并关闭Web服务器。如果我在Procfile中注释掉'resque',web服务器将正常启动


知道如何设置所有这些吗?

这是因为进程退出并在后台生成工作进程,请尝试在Procfile中使用
/bin/resque work
,而不是使用
我没有更多时间来调查此问题。回到旧版本的Resque为我解决了这个问题。我所要做的就是改变我的档案

在我的档案里

gem 'resque', "~> 1.22.0"

不幸的是,这不是Resque 2。

对于来自谷歌的用户,至少根据rails API文档4.2.3版,它只支持
Resque v1.xx