我在现有项目中给出了这个Procfile,我需要设置它。
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
worker: bundle exec rake jobs:work
sidekiq_worker: env DB_POOL=${SIDEKIQ_DB_POOL:-10} bundle exec sidekiq -c ${SIDEKIQ_CONCURRENCY:-4} -q $RAILS_ENV"_magplus_background_job" -i ${DYNO#worker.}
app_build_sidekiq_worker: env DB_POOL=${APP_BUILD_SIDEKIQ_DB_POOL:-3} bundle exec sidekiq -c ${APP_BUILD_SIDEKIQ_CONCURRENCY:-1} -q $RAILS_ENV"_app_build_background_job" -i ${DYNO#worker.}
message_queue_worker: bundle exec rails runner 'MessageQueueWorker.new.perform'
message_queue_publisher: bundle exec rails runner 'Caerbannog::Queue.publish'
我安装了这样的工头。
MAC-Nod-Dev:service-plus dev$ gem install foreman
Successfully installed foreman-0.82.0
1 gem installed
当我foreman start
时,我收到以下错误:
18:19:04 web.1 | started with pid 8129
18:19:04 worker.1 | started with pid 8130
18:19:04 sidekiq_worker.1 | started with pid 8131
18:19:04 app_build_sidekiq_worker.1 | started with pid 8132
18:19:04 message_queue_worker.1 | started with pid 8133
18:19:04 message_queue_publisher.1 | started with pid 8134
18:19:07 web.1 | I, [2016-11-17T18:19:07.856228 #8129] INFO -- : Refreshing Gem list
18:19:08 sidekiq_worker.1 | missing argument: -i
18:19:08 sidekiq_worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/sidekiq-3.3.3/lib/sidekiq/cli.rb:338:in `parse_options'
18:19:08 sidekiq_worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/sidekiq-3.3.3/lib/sidekiq/cli.rb:208:in `setup_options'
18:19:08 sidekiq_worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/sidekiq-3.3.3/lib/sidekiq/cli.rb:38:in `parse'
18:19:08 sidekiq_worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/sidekiq-3.3.3/bin/sidekiq:7:in `<top (required)>'
18:19:08 sidekiq_worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/bin/sidekiq:23:in `load'
18:19:08 sidekiq_worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/bin/sidekiq:23:in `<main>'
18:19:08 sidekiq_worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/bin/ruby_executable_hooks:15:in `eval'
18:19:08 sidekiq_worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/bin/ruby_executable_hooks:15:in `<main>'
18:19:08 app_build_sidekiq_worker.1 | missing argument: -i
18:19:08 app_build_sidekiq_worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/sidekiq-3.3.3/lib/sidekiq/cli.rb:338:in `parse_options'
18:19:08 app_build_sidekiq_worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/sidekiq-3.3.3/lib/sidekiq/cli.rb:208:in `setup_options'
18:19:08 app_build_sidekiq_worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/sidekiq-3.3.3/lib/sidekiq/cli.rb:38:in `parse'
18:19:08 app_build_sidekiq_worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/sidekiq-3.3.3/bin/sidekiq:7:in `<top (required)>'
18:19:08 app_build_sidekiq_worker.1 | /Users/dev.rvm/gems/ruby-2.3.1@serviceplus/bin/sidekiq:23:in `load'
18:19:08 app_build_sidekiq_worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/bin/sidekiq:23:in `<main>'
18:19:08 app_build_sidekiq_worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/bin/ruby_executable_hooks:15:in `eval'
18:19:08 app_build_sidekiq_worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/bin/ruby_executable_hooks:15:in `<main>'
18:19:09 app_build_sidekiq_worker.1 | exited with code 1
18:19:09 system | sending SIGTERM to all processes
18:19:09 sidekiq_worker.1 | exited with code 1
18:19:09 worker.1 | rake aborted!
18:19:09 worker.1 | SignalException: SIGTERM
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/actionpack-4.2.6/lib/action_dispatch/http/response.rb:76:in `require'
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/actionpack-4.2.6/lib/action_dispatch/http/response.rb:76:in `<class:Response>'
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/actionpack-4.2.6/lib/action_dispatch/http/response.rb:36:in `<module:ActionDispatch>'
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/actionpack-4.2.6/lib/action_dispatch/http/response.rb:7:in `<top (required)>'
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/actionpack-4.2.6/lib/action_controller/metal/live.rb:1:in `require'
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/actionpack-4.2.6/lib/action_controller/metal/live.rb:1:in `<top (required)>'
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/actionpack-4.2.6/lib/action_controller.rb:4:in `require'
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/actionpack-4.2.6/lib/action_controller.rb:4:in `<top (required)>'
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/actionpack-4.2.6/lib/action_controller/railtie.rb:2:in `require'
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/actionpack-4.2.6/lib/action_controller/railtie.rb:2:in `<top (required)>'
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/activerecord-4.2.6/lib/active_record/railtie.rb:9:in `require'
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/activerecord-4.2.6/lib/active_record/railtie.rb:9:in `<top (required)>'
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/railties-4.2.6/lib/rails/all.rb:13:in `require'
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/railties-4.2.6/lib/rails/all.rb:13:in `block in <top (required)>'
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/railties-4.2.6/lib/rails/all.rb:11:in `each'
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/gems/railties-4.2.6/lib/rails/all.rb:11:in `<top (required)>'
18:19:09 worker.1 | /Users/dev/munam/projects/magplus/service-plus/config/application.rb:3:in `require'
18:19:09 worker.1 | /Users/dev/munam/projects/magplus/service-plus/config/application.rb:3:in `<top (required)>'
18:19:09 worker.1 | /Users/dev/munam/projects/magplus/service-plus/Rakefile:4:in `require'
18:19:09 worker.1 | /Users/dev/munam/projects/magplus/service-plus/Rakefile:4:in `<top (required)>'
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/bin/ruby_executable_hooks:15:in `eval'
18:19:09 worker.1 | /Users/dev/.rvm/gems/ruby-2.3.1@serviceplus/bin/ruby_executable_hooks:15:in `<main>'
18:19:09 worker.1 | (See full trace by running task with --trace)
18:19:09 message_queue_publisher.1 | terminated by SIGTERM
18:19:09 message_queue_worker.1 | terminated by SIGTERM
18:19:09 worker.1 | exited with code 1
18:19:14 system | sending SIGKILL to all processes
系统中断但奇怪的是,当使用rails s
或foreman run rails s
正常运行rails服务器时,它运行顺利,但我需要与领班一起工作,我需要启动不同的选项卡,显然这是一个更好的方法。如果有人帮助我,我会非常感激。
提前多多感谢!
答案 0 :(得分:0)
您的DYNO变量未设置,因此您没有向-i传递任何内容。它缺少必要的论据。