Skip to content

ActionController::UrlGenerationError: No route matches #48

@RedaBenh

Description

@RedaBenh

Hi,

I'm using

  • ruby "2.7.3"
  • rails "7.0.4"and
  • solidus_sitemap , revision: 7c69f64

i try to generate a sitemap but i get an error "No route matches" when it executes "add_products" or "add_taxons" methods.

Here is the log

$ rake sitemap:create
..
rake aborted!
ActionController::UrlGenerationError: No route matches {:action=>"index", :controller=>"products"}
/Users/redabenh/.rvm/gems/ruby-2.7.3/gems/actionpack-7.0.4/lib/action_dispatch/journey/formatter.rb:44:in `path'
/Users/redabenh/.rvm/gems/ruby-2.7.3/gems/actionpack-7.0.4/lib/action_dispatch/routing/route_set.rb:824:in `url_for'
/Users/redabenh/.rvm/gems/ruby-2.7.3/gems/actionpack-7.0.4/lib/action_dispatch/routing/route_set.rb:271:in `call'
/Users/redabenh/.rvm/gems/ruby-2.7.3/gems/actionpack-7.0.4/lib/action_dispatch/routing/route_set.rb:214:in `call'
/Users/redabenh/.rvm/gems/ruby-2.7.3/gems/actionpack-7.0.4/lib/action_dispatch/routing/route_set.rb:327:in `block in define_url_helper'
/Users/redabenh/.rvm/gems/ruby-2.7.3/bundler/gems/solidus_sitemap-7c69f647ff0a/lib/solidus_sitemap/solidus_defaults.rb:30:in `add_products'
/Users/redabenh/git/paranor/config/sitemap.rb:63:in `block in run'
/Users/redabenh/.rvm/gems/ruby-2.7.3/gems/sitemap_generator-6.3.0/lib/sitemap_generator/interpreter.rb:61:in `instance_eval'
/Users/redabenh/.rvm/gems/ruby-2.7.3/gems/sitemap_generator-6.3.0/lib/sitemap_generator/interpreter.rb:61:in `eval'
/Users/redabenh/.rvm/gems/ruby-2.7.3/gems/sitemap_generator-6.3.0/lib/sitemap_generator/link_set.rb:40:in `create'
/Users/redabenh/.rvm/gems/ruby-2.7.3/gems/sitemap_generator-6.3.0/lib/sitemap_generator.rb:42:in `method_missing'
/Users/redabenh/git/paranor/config/sitemap.rb:34:in `run'
/Users/redabenh/.rvm/gems/ruby-2.7.3/gems/sitemap_generator-6.3.0/lib/sitemap_generator/interpreter.rb:78:in `instance_eval'
/Users/redabenh/.rvm/gems/ruby-2.7.3/gems/sitemap_generator-6.3.0/lib/sitemap_generator/interpreter.rb:78:in `run'
/Users/redabenh/.rvm/gems/ruby-2.7.3/gems/sitemap_generator-6.3.0/lib/sitemap_generator/tasks.rb:51:in `block (2 levels) in <main>'
/Users/redabenh/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/Users/redabenh/.rvm/gems/ruby-2.7.3/bin/ruby_executable_hooks:22:in `eval'
/Users/redabenh/.rvm/gems/ruby-2.7.3/bin/ruby_executable_hooks:22:in `<main>'
Tasks: TOP => sitemap:create
(See full trace by running task with --trace)



The routes are correctly accessible

$ rails routes
...
      Prefix Verb   URI Pattern                                                                                       Controller#Action
                                    root GET    /                                                                                                 home#index
                                products GET    /products(.:format)                                                                               products#index
                                 product GET    /products/:id(.:format)                                                                           products#show
                         cart_line_items POST   /cart_line_items(.:format)                                                                        cart_line_items#create
                              locale_set GET    /locale/set(.:format)                                                                             locale#set
                           select_locale POST   /locale/set(.:format)                                                                             locale#set
...


Any suggestion how to fix this error ?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions