There is a nice option to config for the Rails app:
config.force_ssl = true
However it seems that just putting that to true doesn\'t get the HTTPS connection
Open your Chrome Developer Tools when you're at localhost: Then you can right click the refresh button ↻ and select "Empty cache and hard reload".
This error might also happens to you, if you start your server in the production environment, where HSTS is enabled.
Chrome redirects you to https://localhost:3000/ and says "SSL connection error".