I'm working on an app currently and I attempted to replace my webserver WEBrick
with puma
. The application is currently deployed with Heroku
. Also, while doing this I wanted to be able to run my rails s
with production. To my understanding, I would need to set the SECRET_KEY_BASE
key in my secret.yaml
file. I did this while also setting up a SECRET_TOKEN
in heroku
. To make a long story short, I actually reverted back to WEBrick
webserver. But now, when I run rails s
production or development, I get the following:
=> Booting WEBrick
=> Rails 4.2.5.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2016-04-27 13:40:57] INFO WEBrick 1.3.1
[2016-04-27 13:40:57] INFO ruby 2.2.0 (2014-12-25) [x86_64-darwin14]
[2016-04-27 13:40:57] INFO WEBrick::HTTPServer#start: pid=24061 port=3000
When trying to load the page at https://localhost:3000/
I get the following errors in terminal:
[2016-04-27 13:41:09] ERROR bad URI `]n?Q2}N?<\x01H\x00\x00\x1C?+?/̨̩?\x14?\x13?'.
[2016-04-27 13:41:09] ERROR bad URI `dU?\x00\x00\x1C?+?/̨̩?\x14?\x13?'.
[2016-04-27 13:41:09] ERROR bad Request-Line `\x16\x03\x01\x00?\x01\x00\x00?\x03\x03}??4??CN??\x02\x04?4?\x17??\ea??u%?\x06?yڔ\x13?\x00\x00\x1C?+?/̨̩?\x14?\x13?'.
[2016-04-27 13:41:09] ERROR bad Request-Line `\x16\x03\x01\x00?\x01\x00\x00?\x03\x03????3?W\x14kt??0M\x1A#U?"u?Ä??qj?]}??\x00\x00\x1C?+?/̨̩?\x14?\x13?'.
[2016-04-27 13:41:09] ERROR bad Request-Line `\x16\x03\x01\x00?\x01\x00\x00?\x03\x03?f\x1E?V?4?'.
[2016-04-27 13:41:09] ERROR bad Request-Line `\x16\x03\x01\x00?\x01\x00\x00?\x03\x03??C?ݔ\x01\r?OS#?S??Ej?\\\x15\r\x17k\x0Ep?\x1C?"?F\x00\x00\x1C?+?/̨̩?\x14?\x13?'.
And the following in my DOM:
This site can’t provide a secure connection
localhost sent an invalid response.
ERR_SSL_PROTOCOL_ERROR
So obviously I did something when setting up the SECRET_TOKEN/SECRET_KEY_BASE
because before it was working and now not a single project of mine can run the rails server
. I understand that this is dealing with SSL, but I am unsure where to begin or how to fix this. I have tried and read a lot and have yet to have some luck.
SIDE NOTE: I have created a brand new rails project from scratch and simply tried to run rails s
. I have had the same issue. As I commented below, I was having the same issue when trying to run puma
as my webserver. I now cannot run a local server on ANY project of mine. This leads me to believe that I have messed something up that applies to my system.
Thank you for any time taken/spent to help me.
FIXED:
Okay, so for whatever reason(something I did I'm sure), when I attempted to visit localhost:3000
it would take me to -> https://localhost:3000
which, as you stated, could not be handled by WEBrick unless configured to do so. My address bar continued to force HTTPS, even if I tried visiting http://localhost:3000
. After I cleared my cookies/history...everything is working. I appreciate your help.