Skip to content

Instantly share code, notes, and snippets.

@jlong
Created May 26, 2010 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlong/413883 to your computer and use it in GitHub Desktop.
Save jlong/413883 to your computer and use it in GitHub Desktop.
#\ -p 4000
gem 'activesupport', '2.3.5'
gem 'serve', '0.11.2'
require 'serve'
require 'serve/rack'
root = File.dirname(__FILE__)
use Rack::CommonLogger
use Rack::ShowStatus
use Rack::ShowExceptions
if ENV['SERVER_SOFTWARE'] =~ /passenger/i
run Serve::RackAdapter.new(root + '/views')
else
run Rack::Cascade.new([
Serve::RackAdapter.new(root + '/views'),
Rack::Directory.new(root + '/public')
])
end
@jlong
Copy link
Author

jlong commented May 26, 2010

Of course, just like any other Rack app, if you are using serve with Passenger you will still need a public/ directory, a tmp/ directory, and a tmp/restart.txt.

See:
http://www.modrails.com/documentation/Users%20guide.html#_deploying_a_rack_based_ruby_application

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment