Note that there are some explanatory texts on larger screens.

plurals
  1. POThin with SSL support and ruby-debug
    primarykey
    data
    text
    <p>Does anyone know of a way to run the ruby debugger and SSL at the same time with Thin?</p> <p>I've been using Thin successfully with Rails 3.0.10.</p> <p>I start it using <code>rails server --debugger</code>, and I can debug my code.</p> <p>Recently, I have also needed to add SSL support to my application, and I'd like to be able to test it locally with a self-signed certificate. </p> <p>Unfortunately, I have not found a way to start Thin with SSL support when using <code>rails server</code>.</p> <p>I can successfully start Thin with SSL support by using:</p> <pre><code>thin start --ssl --ssl-verify --ssl-key-file ssllocal/server.key --ssl-cert-file ssllocal/server.crt </code></pre> <p>However, I have not found a way to activate the debugger using <code>thin start</code>.</p> <p><em>So it seems like I have the choice of running the debugger (<code>rails server</code>) or SSL (<code>thin start</code>), but not both.</em></p> <p>It seems possible to get Webrick to run SSL using <code>rails server</code> by modifying the rails/script file (<a href="http://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;sqi=2&amp;ved=0CCEQFjAA&amp;url=http://www.nearinfinity.com/blogs/chris_rohr/configuring_webrick_to_use_ssl.html&amp;ei=53sGT9rTBunu0gHZ-P3XBA&amp;usg=AFQjCNHYkTjUJTeA0nbW-ywpIup83F3Fxw&amp;sig2=dzyS_1rESwyY79HLQ_JVKw" rel="noreferrer">see here</a>). I experimented with this approach, but I have not had success. Here's one of the attempts:</p> <pre><code>#!/usr/bin/env ruby # This command will automatically be run when you run "rails" with Rails 3 # gems installed from the root of your application. APP_PATH = File.expand_path('../../config/application', __FILE__) require File.expand_path('../../config/boot', __FILE__) # THIS IS NEW: require "rails/commands/server" require 'rack' require 'thin' module Rails class Server def default_options super.merge({ :Port =&gt; 3000, :environment =&gt; (ENV['RAILS_ENV'] || "development").dup, :daemonize =&gt; false, :debugger =&gt; false, :pid =&gt; File.expand_path("tmp/pids/server.pid"), :config =&gt; File.expand_path("config.ru"), :SSLEnable =&gt; true :ssl =&gt; true, "ssl-verify" =&gt; true, "ssl-key-file" =&gt; File.expand_path("ssllocal/server.key"), "ssl-cert-file" =&gt; File.expand_path("ssllocal/server.crt") }) end end end require 'rails/commands' </code></pre> <p>Note: for those who might be wondering, I created an 'ssllocal' directory off my root application directory, and that's where I store the ssl keys and certs.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload