我正在尝试使用活动作业的resque。我正在关注link
中指定的介绍我曾尝试使用以下命令启动resque
bundle exec rake resque:work
我收到以下错误
The controller-level `respond_to' feature has been extracted to the `responders` gem. Add it to your Gemfile to continue using this feature:
gem 'responders', '~> 2.0'
Consult the Rails upgrade guide for details.
请查看我的Gemfile一次
source 'https://rubygems.org'
gem 'rails', '4.2.5'
gem 'rails-api', "~> 0.4.0"
gem 'spring', :group => :development
gem "activerecord-import", "~> 0.4.0"
gem 'mysql2', "~> 0.3.0"
gem 'delayed_job'
gem "delayed_job_web"
gem 'delayed_job_active_record'
gem "daemons"
gem 'resque'
gem 'responders'
# ADD-ONS
# Require smarter_csv for data import
gem "smarter_csv", "~> 1.0.19"
gem "active_model_serializers", "~> 0.8.0"
gem "kaminari", "~> 0.16.0"
gem "api-pagination", "~> 4.0.0"
gem "colorize", "~> 0.7.5"
gem "versionist", "~> 1.4.0"
gem "httpclient", "~> 2.6.0.1"
gem "rest-client", "~> 1.7.0"
gem 'devise', '~> 3.4.1'
gem 'omniauth-facebook',"~> 2.0.1"
gem "omniauth-google-oauth2","~> 0.2.6"
# git@github.com:baschtl/devise-token_authenticatable.git
gem 'devise-token_authenticatable'
gem "devise-encryptable" ,'~> 0.1.2'
gem 'minitest', '~> 5.5'
gem "bunny", ">= 1.7.0"
gem 'aws-sdk', '~> 2'
gem 'rantly', '~> 0.3.1'
gem 'forgery', '~> 0.6.0'
gem 'unicorn', '~> 4.8.3'
有什么问题?我无法在线找到解决方案。 我正在使用rails 4.2.5 此外,active_model_serializers必须固定为0.8.0。
提前致谢。
答案 0 :(得分:0)
我的方式(别忘了启动redis-server):
$ git clone https://github.com/cristianbica/activejob-resque.git
$ cd activejob-resque/
$ bundle install
...
$ TERM_CHILD=1 LOGGING=1 QUEUE=* bundle exec rake resque:work
activejob-resque]$ TERM_CHILD=1 LOGGING=1 QUEUE=* bundle exec rake resque:work
*** Starting worker test.lo:17635:*
*** Registered signals
*** Running before_first_fork hooks
*** Checking default
*** Sleeping for 5.0 seconds
*** resque-1.25.2: Waiting for *
...
不包括弃用警告。注意
$ bundle exec rake resque:work
set QUEUE env var, e.g. $ QUEUE=critical,high rake resque:work
你应该至少设置QUEUE环境变量。 以上行动只是为了测试,但首先尝试一下。适合我。