ruby-on-railsruby-on-rails-3webrick

How do you run Rails with HTTPs locally for testing?


Our dev envs use HTTP, prod uses HTTPS, this is causing issues that we can't reproduce locally with are HTTPS related.

How can I run rails with SSL locally for testing purposes? Is there a Webrick config?

Thanks


Solution

  • you should to use thin to do it:

    $ sudo apt-get install thin
    

    And add this line in config/application.rb

    config.force_ssl = true
    

    Then run app on thin with command line:

    $ thin start --ssl