I set the port as 3000 in my application.yml (figaro managing env variables)
rails s
uses port 3000
but when I run foreman start
(as recommended by Her
Mystery on the puma port solved.
Put this print in your config/puma.rb
Then you'll see that somehow the port is mysteriously set to 5000 even though it is not in your ENV.
Fix at bottom.
puma_port = ENV['PORT'] || 3000
puts "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
puts "puma_port is #{puma_port}"
puts "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ”
That prints out
16:49:28 web.1 | ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
16:49:28 web.1 | puma_port is 5000
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
Then place this line in your Procfile (not the one you use for Heroku). I've got one called Procfile.dev
web: PORT=3000 bundle exec puma -C config/puma.rb
And I run it with this command:
foreman start -f Procfile.dev