Wednesday, November 05, 2008

Thwarted by ActionController::MethodNotAllowed

Are you running a rails app locally seeing this:



ActionController::MethodNotAllowed
Only get and post requests are allowed.
RAILS_ROOT: /Users/me/my_rails_project
ActionController::MethodNotAllowed (Only get and post requests are allowed.)



There are of course actual valid reasons this might be happening to you if you're doing something tricky, but if all you're trying to do is browse to a page (which is get request) and it's blowing up with this there may be a simple fix.

Stop script/server and start it again. Then refresh the page.

I've found that sometimes when I edit routes.rb and add a route, particularly if it's a resource, thinks get wonky and I get this error. Restarting script/server ended up fixing my problem when google yielded nothing for me.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home