Skip to content

Instantly share code, notes, and snippets.

@silviorelli
Created April 8, 2011 10:30
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save silviorelli/909614 to your computer and use it in GitHub Desktop.
Save silviorelli/909614 to your computer and use it in GitHub Desktop.
config.ru for using POW Rack server with Rails 2
# Rails.root/config.ru
require "./config/environment"
run ActionController::Dispatcher.new
@mgomes
Copy link

mgomes commented Apr 8, 2011

That path to environment.rb caused me problems. This fixed it:

# Rails.root/config.ru
require "./config/environment"
run ActionController::Dispatcher.new

@silviorelli
Copy link
Author

Updated with mgomes' suggestion

@alessani
Copy link

Pay attention: when you deploy the app you need to remove the config.ru, otherwise you get a bunch of issues, like "missing rails version..."

@gsiener
Copy link

gsiener commented Apr 29, 2011

Thanks!

@tomazzlender
Copy link

thank you!

@subimage
Copy link

subimage commented Jun 8, 2013

FYI: this really isn't the best way to do things. I had some Rails metal stuff and couldn't get it to load until I pasted the contents of "rake middleware" into the config.ru file. Mine ended up looking like so:

# Rackup file required for Pow.cx
require File.dirname(__FILE__) + '/config/environment'

use Rack::Lock
use ActionController::Failsafe
use ActionController::Session::RedisSessionStore
use Rails::Rack::Metal
use ActionController::ParamsParser
use Rack::MethodOverride
use Rack::Head
use ActionController::StringCoercion
use Sass::Plugin::Rack
use ActiveRecord::ConnectionAdapters::ConnectionManagement
use ActiveRecord::QueryCache
run ActionController::Dispatcher.new

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