Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.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 如何在生产环境中运行延迟的_作业_Ruby On Rails_Ruby_Ruby On Rails 4_Delayed Job - Fatal编程技术网

Ruby on rails 如何在生产环境中运行延迟的_作业

Ruby on rails 如何在生产环境中运行延迟的_作业,ruby-on-rails,ruby,ruby-on-rails-4,delayed-job,Ruby On Rails,Ruby,Ruby On Rails 4,Delayed Job,我在rails应用程序开发中使用delayed_作业,在开发环境中使用bin/delayed_作业开始 但在生产环境中如何做到这一点呢 RAILS_ENV=production bin/delayed_job start 这将使延迟的作业在生产环境中运行,以启动: cd /home/user/app; bundle exec /usr/bin/env RAILS_ENV=production /home/user/app/script/delayed_job start 停止: cd /ho

我在rails应用程序开发中使用delayed_作业,在开发环境中使用
bin/delayed_作业开始

但在生产环境中如何做到这一点呢

RAILS_ENV=production bin/delayed_job start
这将使延迟的作业在生产环境中运行,以启动:

cd /home/user/app;
bundle exec /usr/bin/env RAILS_ENV=production /home/user/app/script/delayed_job start
停止:

cd /home/user/app; 
bundle exec /usr/bin/env RAILS_ENV=production /home/user/app/script/delayed_job stop
请参阅官方文档,网址为


如果其他人遇到-bash:bin/delayed_job:Permission denied错误,就像上面Disha在评论中所做的那样,对于Centos来说,将项目目录中bin/folder中的delayed_job设置为可执行就足够了。

我真的被困在这里了。。谢谢一个快速解决方案这给了我权限错误--bash:
bin/delayed\u作业:权限被拒绝
。使用Centos进行生产。有什么建议吗?调用此命令时您是否在rails项目目录中?
RAILS_ENV=production script/delayed_job start
RAILS_ENV=production script/delayed_job stop

# Runs two workers in separate processes.
RAILS_ENV=production script/delayed_job -n 2 start
RAILS_ENV=production script/delayed_job stop

# Set the --queue or --queues option to work from a particular queue.
RAILS_ENV=production script/delayed_job --queue=tracking start
RAILS_ENV=production script/delayed_job --queues=mailers,tasks start

# Use the --pool option to specify a worker pool. You can use this option multiple times to start different numbers of workers for different queues.
# The following command will start 1 worker for the tracking queue,
# 2 workers for the mailers and tasks queues, and 2 workers for any jobs:
RAILS_ENV=production script/delayed_job --pool=tracking --pool=mailers,tasks:2 --pool=*:2 start

# Runs all available jobs and then exits
RAILS_ENV=production script/delayed_job start --exit-on-complete
# or to run in the foreground
RAILS_ENV=production script/delayed_job run --exit-on-complete