我有一個部署在heroku上的美洲獅導軌應用程序。似乎一切都很好,除非我在dev env啓動我的應用程序的端口是5000而不是3000.rails localhost + heroku puma config
爲什麼會發生這種情況?根據我的配置文件,它應該回退到3000,就像線程和併發數字(那些工作正常)。
Procfile.dev
web: bundle exec puma -C config/puma.rb
配置/ 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
爲什麼,工頭把$端口連接到過程與foreman start -f Procfile.dev
12:36:51 web.1 | [12816] Puma starting in cluster mode...
12:36:51 web.1 | [12816] * Version 2.13.4 (ruby 2.2.3-p173), codename: A Midsummer Code's Dream
12:36:51 web.1 | [12816] * Min threads: 5, max threads: 5
12:36:51 web.1 | [12816] * Environment: development
12:36:51 web.1 | [12816] * Process workers: 2
12:36:51 web.1 | [12816] * Preloading application
12:37:08 web.1 | [12816] * Listening on tcp://0.0.0.0:5000
12:37:08 web.1 | [12816] ! WARNING: Detected 1 Thread(s) started in app boot:
12:37:08 web.1 | [12816] ! #<Rack::MiniProfiler::FileStore::CacheCleanupThread:[email protected]/Users/Silo/.rvm/gems/ruby-2.2.3/gems/rack-mini-profiler-0.9.8/lib/mini_profiler/storage/file_store.rb:53 sleep> - /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rack-mini-profiler-0.9.8/lib/mini_profiler/storage/file_store.rb:71:in `sleep'
12:37:08 web.1 | [12816] Use Ctrl-C to stop
12:37:08 web.1 | [12816] - Worker 0 (pid: 12822) booted, phase: 0
12:37:08 web.1 | [12816] - Worker 1 (pid: 12823) booted, phase: 0