Created
March 31, 2009 06:28
-
-
Save moro/88086 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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