我正在使用Puma网络服务器和ActiveAdmin。当尝试在生产中加载用户的活动管理页面时,我得到大约1/4的502错误。我该如何纠正这个错误?
屏幕显示:
502 Bad Gateway
nginx/1.8.0
日志显示:
2016-02-17T20:05:47.175Z - app I, [2016-02-17T20:05:47.194213 #15715] INFO -- : Started GET "/admin/users" for 127.0.0.1 at 2016-02-17 20:05:47 +0000
2016-02-17T20:05:47.178Z - app I, [2016-02-17T20:05:47.196358 #15715] INFO -- : Processing by Admin::UsersController#index as HTML
2016-02-17T20:05:54.579Z - app [69] - Worker 0 (pid: 15959) booted, phase: 0
配置/ puma.rb
workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['MAX_THREADS'] || 5)
threads threads_count, threads_count
preload_app!
rackup DefaultRackup
port ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'development'
on_worker_boot do
ActiveRecord::Base.establish_connection
end