This error is normal when trying to access Rails via SSL when starting from rails server , unless you crack the default rails server script to support SSL. You can see this blog post on how to do this. However, I would recommend just not accessing your application via SSL on your local machine.
You probably have a configuration in your Rails application that redirects SSL when you start the production environment. Try temporarily commenting on this configuration so that you can run it without having to configure SSL on your local machine.
Take a look at production.rb for:
config.force_ssl = true
Or look in application_controller.rb (or any other controller) for:
force_ssl
Note: they have the same name, but under the hood they work differently.
Alternatively, you can run Rails on your local computer using a web server other than rails server , but this is beyond the scope of this question, and you still have to configure it to support SSL. Personally, I have a nginx installation (with a unicorn) on my local machine with a self-signed SSL certificate so that I can easily test the SSL related behavior in my application.
In addition, you can consider alternative ways of debugging your application, in addition to launching it during production on your local machine, but exactly how to do this depends on the nature of the error you are trying to debug.
source share