title: Why does '/' match correctly to a Rack application in my Rails 3 app, but no other route does?
body: <p>I'm using Rails 3.0.6.</p>
  
  <p>In my lib directory I have a example_app.rb, which is simply a Sinatra app: </p>
  
  <pre><code>class ExampleApp &lt; Sinatra::Base
    get '/' do
      "Hello from Sinatra"
    end
  end
  </code></pre>
  
  <p>And I'm autoloading it with the application.rb config.auto_load_paths configuration.</p>
  
  <p>In my routes file, I have only: </p>
  
  <pre><code>match "/" =&gt; ExampleApp
  </code></pre>
  
  <p>And that matches fine when I run the rails server (Webrick). However if I try: </p>
  
  <pre><code>match "/example" =&gt; ExampleApp
  </code></pre>
  
  <p>Visiting localhost:3000/example gives me a 'No route matches "/example"' error. Running rake routes shows the route though: </p>
  
  <pre><code>example  /example(.:format) {:to=&gt;ExampleApp}
  </code></pre>
  
  <p>If I try and match '/example' against a controller action it works fine, but not to that Sinatra app up above, so I'm not sure what's going on. I know there's something small I'm missing that I'm not finding in the routing documentation on the Rails site. </p>
  
  <p>Thanks for any help.</p>