joshmn / ahoy_captain

A full-featured, mountable analytics dashboard for your Rails app, powered by the Ahoy gem.
MIT License
356 stars 18 forks source link

Accessing /ahoy_captain - undefined method `with_option_content' #31

Closed james05 closed 11 months ago

james05 commented 11 months ago

Getting this error when trying to access the dashboard:

undefined methodwith_option_content' for #<AhoyCaptain::DropdownLinkComponent:0x00007f25a0495f08 @title="Campaign", @classes=nil, @vc_original_view_context=#, @view_context=#, @output_buffer="<div class=\"dropdown dropdown-end\" data-controller='dropdown-label'>\n <label\n tabindex=\"0\"\n class=\"cursor-pointer flex \"\n data-action='click->dropdown-label#removeHidden'\n >\n <span data-dropdown-label-target=\"label\">Campaign\n\n \n <ul class=\"dropdown-content z-[1] menu p-2 shadow bg-base-100 rounded-box w-52\" data-dropdown-label-target=\"close\">\n", @lookup_context=#<ActionView::LookupContext:0x00007f25a04e5788 @details_key=#<ActionView::TemplateDetails::Requested:0x00007f25a3b83240 @locale=[:en], @handlers=[:raw, :erb, :html, :builder, :ruby, :jbuilder], @formats=[:html], @variants=[], @locale_idx={:en=>0, nil=>1}, @handlers_idx={:raw=>0, :erb=>1, :html=>2, :builder=>3, :ruby=>4, :jbuilder=>5, nil=>6}, @formats_idx={:html=>0, nil=>1}, @variants_idx={nil=>0}>, @digest_cache=nil, @cache=true, @prefixes=["ahoy_captain/roots", "ahoy_captain/application"], @details={:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :jbuilder]}, @view_paths=#<ActionView::PathSet:0x00007f25a04e5508 @paths=[#<ActionView::FileSystemResolver:0x00007f25a36c05f0 @unbound_templates=#, @pathparser=#<ActionView::Resolver::PathParser:0x00007f25a368c6b0 @regex=/ \A (?:(?.*)\/)? (?)? (?.?) (?:.(?[a-z]{2}(?:[-_][A-Z]{2})?))?? (?:.(?html|text|js|css|ics|csv|vcf|vtt|png|jpeg|gif|bmp|tiff|svg|mpeg|mp3|ogg|m4a|webm|mp4|otf|ttf|woff|woff2|xml|rss|atom|yaml|multipart_form|url_encoded_form|json|pdf|zip|gzip|turbo_stream))?? (?:+(?[^.]))?? (?:.(?raw|erb|html|builder|ruby|jbuilder))? \z /x>, @path="/home/james/src/clubs/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c08e8 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/letter_opener_web-1.4.0/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c0ac8 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/bootstrap5-kaminari-views-0.0.1/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c0d70 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/kaminari-core-1.2.2/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c1040 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/paul_revere-3.3.0/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c12c0 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/devise-4.8.1/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c1568 @unbound_templates=#, @pathparser=#<ActionView::Resolver::PathParser:0x00007f25a368c570 @regex=/ \A (?:(?.*)\/)? (?)? (?.?) (?:.(?[a-z]{2}(?:[-_][A-Z]{2})?))?? (?:.(?html|text|js|css|ics|csv|vcf|vtt|png|jpeg|gif|bmp|tiff|svg|mpeg|mp3|ogg|m4a|webm|mp4|otf|ttf|woff|woff2|xml|rss|atom|yaml|multipart_form|url_encoded_form|json|pdf|zip|gzip|turbo_stream))?? (?:+(?[^.]))?? (?:.(?raw|erb|html|builder|ruby|jbuilder))? \z /x>, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/ahoy_captain-1.0.0/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c1748 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/view_component-2.82.0/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c19c8 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/turbo-rails-1.4.0/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c1b80 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/active_analytics-0.2.1/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c1d60 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/actiontext-7.0.4/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c2080 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/actionmailbox-7.0.4/app/views">]>>, @view_renderer=#<ActionView::Renderer:0x00007f25a04cb7c0 @lookup_context=#<ActionView::LookupContext:0x00007f25a04e5788 @details_key=#<ActionView::TemplateDetails::Requested:0x00007f25a3b83240 @locale=[:en], @handlers=[:raw, :erb, :html, :builder, :ruby, :jbuilder], @formats=[:html], @variants=[], @locale_idx={:en=>0, nil=>1}, @handlers_idx={:raw=>0, :erb=>1, :html=>2, :builder=>3, :ruby=>4, :jbuilder=>5, nil=>6}, @formats_idx={:html=>0, nil=>1}, @variants_idx={nil=>0}>, @digest_cache=nil, @cache=true, @prefixes=["ahoy_captain/roots", "ahoy_captain/application"], @details={:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :jbuilder]}, @view_paths=#<ActionView::PathSet:0x00007f25a04e5508 @paths=[#<ActionView::FileSystemResolver:0x00007f25a36c05f0 @unbound_templates=#, @pathparser=#<ActionView::Resolver::PathParser:0x00007f25a368c6b0 @regex=/ \A (?:(?.*)\/)? (?)? (?.?) (?:.(?[a-z]{2}(?:[-_][A-Z]{2})?))?? (?:.(?html|text|js|css|ics|csv|vcf|vtt|png|jpeg|gif|bmp|tiff|svg|mpeg|mp3|ogg|m4a|webm|mp4|otf|ttf|woff|woff2|xml|rss|atom|yaml|multipart_form|url_encoded_form|json|pdf|zip|gzip|turbo_stream))?? (?:+(?[^.]))?? (?:.(?raw|erb|html|builder|ruby|jbuilder))? \z /x>, @path="/home/james/src/clubs/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c08e8 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/letter_opener_web-1.4.0/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c0ac8 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/bootstrap5-kaminari-views-0.0.1/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c0d70 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/kaminari-core-1.2.2/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c1040 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/paul_revere-3.3.0/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c12c0 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/devise-4.8.1/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c1568 @unbound_templates=#, @pathparser=#<ActionView::Resolver::PathParser:0x00007f25a368c570 @regex=/ \A (?:(?.*)\/)? (?)? (?.?) (?:.(?[a-z]{2}(?:[-_][A-Z]{2})?))?? (?:.(?html|text|js|css|ics|csv|vcf|vtt|png|jpeg|gif|bmp|tiff|svg|mpeg|mp3|ogg|m4a|webm|mp4|otf|ttf|woff|woff2|xml|rss|atom|yaml|multipart_form|url_encoded_form|json|pdf|zip|gzip|turbo_stream))?? (?:+(?[^.]))?? (?:.(?raw|erb|html|builder|ruby|jbuilder))? \z /x>, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/ahoy_captain-1.0.0/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c1748 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/view_component-2.82.0/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c19c8 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/turbo-rails-1.4.0/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c1b80 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/active_analytics-0.2.1/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c1d60 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/actiontext-7.0.4/app/views">, #<ActionView::FileSystemResolver:0x00007f25a36c2080 @unbound_templates=#, @path_parser=#, @path="/home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/actionmailbox-7.0.4/app/views">]>>, @cache_hits={}>, @view_flow=#<ActionView::OutputFlow:0x00007f25a04cb680 @content={}>, @virtual_path="/ahoy_captain/dropdown_link_component", @vc_variant=nil, @current_template=nil, @vc_content_evaluated=true, @vc_render_in_block=#<Proc:0x00007f25a0495e40 /home/james/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/ahoy_captain-1.0.0/app/views/ahoy_captain/roots/show.html.erb:50>>`

Ruby 3.1.0

stacktrace.txt Gemfile_lock.txt

rdlugosz commented 6 months ago

This is because you need a newer version of the ViewComponent gem. It looks like the ahoy_captain gemspec has an update to account for this, but maybe it isn't in the current released gem (which is why I ended up here).