The first time I deployed my rails app, I deployed with standard Web brick server. In fact I deployed a couple of Rails apps using Web brick. It was only after listening to a podcast from Ruby Rogues I realised I needed to update my applications. During this podcast everyone made fun of Devs who deploy Rails using Web brick. I was so ashamed that I was one those Devs, so I decided to fix the problem.
Why is it not good to use Web Brick server in Production?
Well Web brick is more of a development server thus it is only meant to be used in development environment.
How to resolve this problem?
It’s actually simple, all you need to do is specify an alternative server in your Gemfile under your Prod settings. The server which I’m using is thin
. It’s that’s simple.
If you’re running your rails app in Heroku change your Procfile
group :production do gem 'pg' gem 'thin' end
web: bundle exec rails server thin -p $PORT -e $RACK_ENV as