views:

39

answers:

1

I've placed the file rack_app.rb with simple Rack application in the lib directory:

class RackApp
  def call env
    [200, {}, 'Hello']
  end
end

Then I've added this route:

match 'rack' => RackApp

And when I try to launch the rails server I get the following error:

config/routes.rb:65: uninitialized constant RackApp (NameError)

+3  A: 

Rails 3 has no more autoloading by default. So you need require your file

require 'lib/rack_app.rb'

Or come back the autoloading in application.rb

config.autoload_paths += %W( #{config.root}/lib )
shingara
I had the same issue just today thanks to old documentation.
qpingu