Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActionController::UrlGenerationError: No route matches #48

Open
RedaBenh opened this issue Jan 17, 2023 · 0 comments · May be fixed by #50
Open

ActionController::UrlGenerationError: No route matches #48

RedaBenh opened this issue Jan 17, 2023 · 0 comments · May be fixed by #50

Comments

@RedaBenh
Copy link

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

@embold-tyler embold-tyler linked a pull request Aug 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant