# Rails 2.3 really checks for presence of $RAILS\_ROOT/public/index.html

**URL:** <https://www.ruby-forum.com/t/rails-2-3-really-checks-for-presence-of-rails-root-public-index-html/163503>\
**Category:** Rails\
**Created:** [March 21, 2009, 1:28am UTC](https://www.ruby-forum.com/t/rails-2-3-really-checks-for-presence-of-rails-root-public-index-html/163503 "2009-03-21T01:28:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sudhir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@Sudhir](https://www.ruby-forum.com/u/Sudhir)\
**Post date:** [March 21, 2009, 1:28am UTC](https://www.ruby-forum.com/t/rails-2-3-really-checks-for-presence-of-rails-root-public-index-html/163503/1 "2009-03-21T01:28:48Z")

</div>

Just sharing a Rail 2.3.2 upgrade experience. My app was running on  
2.1.1 before I upgraded.

Most things worked but I could not get my default route in routes.rb  
to work. The default route URL was “/”. I had a route like this in  
routes.rb as the very last route:

map.connect “”, :controller =\> “foo”, :action =\> “bar”

So users who went to the base URL would be directed to the foo  
controller.

This stopped working with Rails 2.3.2 and I wasted half a day figuring  
out what was wrong. Turns out, I just needed to delete public/  
index.html. That’s it. The same route works perfectly after deleting  
that file.

There is a comment in the Rails code which mentions this but I don’t  
see it in the documentation for Rails routes.

---

<div class="post-metadata">

**Author:** ![Sudhir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@Sudhir](https://www.ruby-forum.com/u/Sudhir)\
**Post date:** [March 21, 2009, 9:51am UTC](https://www.ruby-forum.com/t/rails-2-3-really-checks-for-presence-of-rails-root-public-index-html/163503/2 "2009-03-21T09:51:10Z")

</div>

On 21 Mar., 01:28, Sudhir [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> controller.
> 
> This stopped working with Rails 2.3.2 and I wasted half a day figuring  
> out what was wrong. Turns out, I just needed to delete public/  
> index.html. That’s it. The same route works perfectly after deleting  
> that file.
> 
> There is a comment in the Rails code which mentions this but I don’t  
> see it in the documentation for Rails routes.

On 21 Mar., 01:28, Sudhir [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> controller.
> 
> This stopped working with Rails 2.3.2 and I wasted half a day figuring  
> out what was wrong. Turns out, I just needed to delete public/  
> index.html. That’s it. The same route works perfectly after deleting  
> that file.
> 
> There is a comment in the Rails code which mentions this but I don’t  
> see it in the documentation for Rails routes.

As far as I know your web server will always look in the /public  
directory to see if any files matches the request, if not it will pass  
the request on to the app server. So this really shouldn’t have worked  
before either…

And by the way, you usually use map.root to make a route that matches  
a request to the root:

map.root :controller =\> “foo”, :action =\> “bar”

–  
Cheers,  
David K.  
[http://twitter.com/rubyguy](http://twitter.com/rubyguy)
