# MethodNotAllowed error when reloading routes on Rails 2.1

**URL:** <https://www.ruby-forum.com/t/methodnotallowed-error-when-reloading-routes-on-rails-2-1/148189>\
**Category:** Rails\
**Created:** [September 10, 2008, 8:23am UTC](https://www.ruby-forum.com/t/methodnotallowed-error-when-reloading-routes-on-rails-2-1/148189 "2008-09-10T08:23:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francesca\_Resta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f4b2a3/32.png) [@Francesca\_Resta](https://www.ruby-forum.com/u/Francesca_Resta)\
**Post date:** [September 10, 2008, 8:23am UTC](https://www.ruby-forum.com/t/methodnotallowed-error-when-reloading-routes-on-rails-2-1/148189/1 "2008-09-10T08:23:16Z")

</div>

Hello,  
I’m using Rails 2.1 on apache and in some functions of my application  
I need to reload routes on the fly.  
Now and then, it raises a MethodNotAllowed exception (“Only get, post,  
put, and delete requests are allowed”), and after this my application  
will not work at all until I restart apache.  
This error doesn’t appear everytime when a specific function is called  
but it just occurs sometimes.  
I had some experiments to better understand the reasons of it, and it  
looks like it’s a matter of time: if I call the routes reload on a  
before filter, it occurs less often, and if I add a delay it occurs  
even lesser.  
This brought me to suppose that it happens if the routes reloading  
isn’t still completed when the other operations on the page have  
finished their work.  
But obviously to try to guess how much it can take and to hope the  
delay will be enough it’s not a solution at all.  
How can I know when the routes reloading is completely ended? … it  
may help, if I am right with my supposition.  
Or can you suggest me how to solve this problem?

Thank you in advance.  
Francesca.
