Brand new generated Rails 4.2.0 project. Ran rails s
, behaved as expected using WEBrick:
vagrant@web1:~$ netstat -nlpt
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:3000 0.0.0.0:* LISTEN 27158/ruby2.1
tcp6 0 0 ::1:3000 :::* LISTEN 27158/ruby2.1
Added puma to Gemfile, ran bundle, then rails s
again; came up with Puma, but only bound tcp6 interface, not tcp:
vagrant@web1:~$ netstat -nlpt
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp6 0 0 ::1:3000 :::* LISTEN 27116/ruby2.1
Any clue why? I've been googling with no luck.
UPDATE:
Running puma -b tcp://0.0.0.0:3000
works. However, adding the bind directive to config/puma.rb and running rails s
doesn't:
bind 'tcp://0.0.0.0:3000'
The threads/workers directives in my config file are working, however, so I know the config file is getting loaded and used. (Even added a puts statement to be sure.)
The config file even gets picked up if I just run puma
, binding to the correct interface. I may just have to resort to running puma
instead of rails s
, even though it's annoying and has to be added to my developer docs.
UPDATE2:
I was mistaken. Running rails s
does not pick up config/puma.rb automatically. Still investigating...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…