Skip to content

Instantly share code, notes, and snippets.

@moro
Created March 31, 2009 06:28
Show Gist options
  • Save moro/88086 to your computer and use it in GitHub Desktop.
Save moro/88086 to your computer and use it in GitHub Desktop.
# coding:utf-8
# vim:set ft=ruby:
require 'rubygems'
gem 'thin', '1.0.0'
require 'rack/adapter/rails'# provided by thin.
prefix = "/myapp"
start = Time.now
opts = {:prefix => prefix, :root => File.expand_path("..", File.dirname(__FILE__))}
rails = Rack::Adapter::Rails.new(opts)
puts "=> Loaded application in #{Time.now - start} sec."
begin
require_library_or_gem 'ruby-debug'
Debugger.start
Debugger.settings[:autoeval] = true if Debugger.respond_to?(:settings)
puts "=> Debugger enabled"
rescue Exception
puts "You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'"
exit
end
run Rack::URLMap.new(prefix => rails)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment