Ruby Error
ActionController::RoutingError
ActionController::RoutingError is raised when Rails cannot find a route matching the requested URL. This typically results in a 404 Not Found response.
Common causes
- User accessing non-existent URL
- Broken links within the application
- Missing route definition in routes.rb
- Incorrect HTTP method for route
- Bots/crawlers accessing invalid paths
How to fix it
- Add catch-all route for custom 404 page
- Verify route exists with rails routes
- Check for typos in link_to paths
- Use named route helpers instead of hardcoded paths
- Implement proper 404 monitoring to find broken links
Example
ActionController::RoutingError example
# Error when accessing /nonexistent
# => ActionController::RoutingError: No route matches [GET] "/nonexistent"
# Add catch-all route (at end of routes.rb)
Rails.application.routes.draw do
# ... other routes ...
match '*path', to: 'errors#not_found', via: :all
end
# ErrorsController
class ErrorsController < ApplicationController
def not_found
render file: 'public/404.html', status: :not_found
end
end Track ActionController::RoutingError with Checkend
Checkend automatically captures ActionController::RoutingError errors in your Ruby application with full context:
- Complete backtrace with syntax highlighting
- Request context (URL, params, headers)
- Automatic grouping of similar errors
- Instant notifications when errors occur
Related errors
Stop debugging in production
Get full error context and fix issues faster with self-hosted error tracking.