Heroku没有选择正确的web服务器
我想在heroku托管的rails应用程序中使用unicorn。我跟着赫罗库 . 但heroku似乎选择了“瘦”web服务器而不是“独角兽”。下面是我的heroku仪表板的屏幕截图 从这个数据板上,我确信heroku知道我的Procfile,但是当我运行时Heroku没有选择正确的web服务器,heroku,unicorn,Heroku,Unicorn,我想在heroku托管的rails应用程序中使用unicorn。我跟着赫罗库 . 但heroku似乎选择了“瘦”web服务器而不是“独角兽”。下面是我的heroku仪表板的屏幕截图 从这个数据板上,我确信heroku知道我的Procfile,但是当我运行时 heroku ps logs --app vamos-test 我有以下日志 === run: one-off dyno run.1: up for 5m: `bash` === web: `bundle exec thin st
heroku ps logs --app vamos-test
我有以下日志
=== run: one-off dyno
run.1: up for 5m: `bash`
=== web: `bundle exec thin start -p $PORT`
web.1: created for 30s
从这些日志中,我假设“瘦”是我的应用服务器
我还尝试了一些命令来解决问题:
heroku ps:scale web=1 --app vamos-test
heroku ps:restart --app vamos-test
但我仍然得到与上面相同的日志
这是我的config/unicorn.rb文件
#config/unicorn.rb
worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3)
timeout 15
preload_app true
before_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
Process.kill 'QUIT', Process.pid
end
defined?(ActiveRecord::Base) and
ActiveRecord::Base.connection.disconnect!
end
after_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
end
defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection
end
#config/unicorn.rb
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
这里是我的Procfile
#config/unicorn.rb
worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3)
timeout 15
preload_app true
before_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
Process.kill 'QUIT', Process.pid
end
defined?(ActiveRecord::Base) and
ActiveRecord::Base.connection.disconnect!
end
after_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
end
defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection
end
#config/unicorn.rb
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
并且麒麟gem正确地包含在Gemfile中
我错过什么了吗?请帮帮我。从文件中删除
thin
时会发生什么情况?还有你档案里的那一行?另外,我猜你没有真正运行heroku ps日志,对吧?这不是有效的命令?@JonMountjoy我的gem文件中没有thin。Channa,你找到解决方案了吗?@Walksalong还没有。你知道吗?