Caching in production caused 'In order to use #url_for, you must include routing helpers explicitly. For instance, include Rails.application.routes.url_helpers.' Replaced key hash in expire_fragment in cache_helper with string obtained by calling Rails.application.routes.url_helpers.url_for directly.