A recent commit changed the “unicorn port” from 9292 to 3000. I don’t see any way to change the port now and this is confliciting with another rails site I have running on 3000. Previously, I’ve been running discourse as bundle exec rails server --port=3001, but this no longer works as unicorn is now grabbing 3000.
Tried a few combinations of UNICORN_PORT=3001, --port=3001, changing source code of unicorn.conf, but end up with:
I, [2018-08-14T11:26:11.496753 #63852] INFO – : listening on addr=0.0.0.0:3000 fd=20
There are 2 schools of thought when it comes to launching a rails server in development.
The @sam school of thought, where you want to keep console pristine cause you are a fanatical puts debugger. That way you can just add puts statements around the app and see the output in the same window you run the server.
If you subscribe to @sam’s school of thought you launch your rails server with:
If you want a different port, you run
bin/unicorn -p 7777
The other school of thought is the @tgxworld school of thought / Rails official setup. In this case are not a puts debugger and want to see all the debug rails logs in the console.
If you are like this you would launch unicorn in dev via
If you want a custom port you will use
bin/rails s -p 7777
Note, I had to push a few fixes to make this post true, so pull latest.
Yeah, I launch my local dev with Puma via Foreman so I think I get “puts” in the Foreman logs and “logger.log” in the Rails log, so I think I’m with the @sam school in my other project. Nice to have these two schools for Discourse local dev now!