igorkasyanchuk / rails_performance

Monitor performance of you Rails applications (self-hosted and free)
https://www.railsjazz.com/
MIT License
957 stars 54 forks source link

undefined method `insert_css_file' for #<ActionView::Base:0x0000000005cc88> #33

Closed existentialmutt closed 1 year ago

existentialmutt commented 3 years ago

Not sure why this isn't working. When I go to /rails/performance I get the above error. App is Rails 6.1.3.1, Ruby 2.7.2

I tried adding the code for the missing method to my own app's ApplicationHelper but this didn't work.

Here's my config file:

RailsPerformance.setup do |config|
  config.redis = Redis::Namespace.new("#{Rails.env}-rails-performance", redis: Redis.new)
  config.duration = 7.days

  config.debug = false # currently not used>
  config.enabled = true

  # default path where to mount gem
  config.mount_at = '/rails/performance'

  # protect your Performance Dashboard with HTTP BASIC password
  # config.http_basic_authentication_enabled = false
  # config.http_basic_authentication_user_name = 'rails_performance'
  # config.http_basic_authentication_password = 'password12'

  # if you need an additional rules to check user permissions
  # config.verify_access_proc = proc { |controller| true }
  # for example when you have `current_user`
  config.verify_access_proc = proc { |controller| controller.current_user&.admin? }

  # You can ignore endpoints with Rails standard notation controller#action
  # config.ignored_endpoints = ['HomeController#contact']
end if defined?(RailsPerformance)

And the backtrace for the error:

rails_performance (1.0.1) app/views/rails_performance/stylesheets/_stylesheets.html.erb:1
actionview (6.1.3.1) lib/action_view/base.rb:247:in `public_send'
actionview (6.1.3.1) lib/action_view/base.rb:247:in `_run'
actionview (6.1.3.1) lib/action_view/template.rb:154:in `block in render'
activesupport (6.1.3.1) lib/active_support/notifications.rb:205:in `instrument'
actionview (6.1.3.1) lib/action_view/template.rb:345:in `instrument_render_template'
actionview (6.1.3.1) lib/action_view/template.rb:152:in `render'
actionview (6.1.3.1) lib/action_view/renderer/partial_renderer.rb:285:in `block in render_partial_template'
activesupport (6.1.3.1) lib/active_support/notifications.rb:203:in `block in instrument'
activesupport (6.1.3.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.1.3.1) lib/active_support/notifications.rb:203:in `instrument'
actionview (6.1.3.1) lib/action_view/renderer/partial_renderer.rb:280:in `render_partial_template'
actionview (6.1.3.1) lib/action_view/renderer/partial_renderer.rb:271:in `render'
actionview (6.1.3.1) lib/action_view/renderer/renderer.rb:81:in `render_partial_to_object'
actionview (6.1.3.1) lib/action_view/renderer/renderer.rb:53:in `render_partial'
actionview (6.1.3.1) lib/action_view/helpers/rendering_helper.rb:45:in `render'
haml (5.2.1) lib/haml/helpers/action_view_mods.rb:15:in `render'
rails_performance (1.0.1) app/views/rails_performance/layouts/rails_performance.html.erb:9
actionview (6.1.3.1) lib/action_view/base.rb:247:in `public_send'
actionview (6.1.3.1) lib/action_view/base.rb:247:in `_run'
actionview (6.1.3.1) lib/action_view/template.rb:154:in `block in render'
activesupport (6.1.3.1) lib/active_support/notifications.rb:205:in `instrument'
actionview (6.1.3.1) lib/action_view/template.rb:345:in `instrument_render_template'
actionview (6.1.3.1) lib/action_view/template.rb:152:in `render'
actionview (6.1.3.1) lib/action_view/renderer/template_renderer.rb:72:in `block in render_with_layout'
activesupport (6.1.3.1) lib/active_support/notifications.rb:203:in `block in instrument'
activesupport (6.1.3.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.1.3.1) lib/active_support/notifications.rb:203:in `instrument'
actionview (6.1.3.1) lib/action_view/renderer/template_renderer.rb:70:in `render_with_layout'
actionview (6.1.3.1) lib/action_view/renderer/template_renderer.rb:55:in `render_template'
actionview (6.1.3.1) lib/action_view/renderer/template_renderer.rb:11:in `render'
actionview (6.1.3.1) lib/action_view/renderer/renderer.rb:61:in `render_template_to_object'
actionview (6.1.3.1) lib/action_view/renderer/renderer.rb:29:in `render_to_object'
actionview (6.1.3.1) lib/action_view/rendering.rb:117:in `block in _render_template'
actionview (6.1.3.1) lib/action_view/base.rb:273:in `in_rendering_context'
actionview (6.1.3.1) lib/action_view/rendering.rb:116:in `_render_template'
actionpack (6.1.3.1) lib/action_controller/metal/streaming.rb:218:in `_render_template'
actionview (6.1.3.1) lib/action_view/rendering.rb:103:in `render_to_body'
actionpack (6.1.3.1) lib/action_controller/metal/rendering.rb:52:in `render_to_body'
actionpack (6.1.3.1) lib/action_controller/metal/renderers.rb:142:in `render_to_body'
actionpack (6.1.3.1) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (6.1.3.1) lib/action_controller/metal/rendering.rb:36:in `render'
actionpack (6.1.3.1) lib/action_controller/metal/instrumentation.rb:46:in `block (2 levels) in render'
benchmark (0.1.1) lib/benchmark.rb:308:in `realtime'
activesupport (6.1.3.1) lib/active_support/core_ext/benchmark.rb:14:in `ms'
actionpack (6.1.3.1) lib/action_controller/metal/instrumentation.rb:46:in `block in render'
actionpack (6.1.3.1) lib/action_controller/metal/instrumentation.rb:86:in `cleanup_view_runtime'
activerecord (6.1.3.1) lib/active_record/railties/controller_runtime.rb:34:in `cleanup_view_runtime'
actionpack (6.1.3.1) lib/action_controller/metal/instrumentation.rb:45:in `render'
wicked_pdf (1.1.0) lib/wicked_pdf/pdf_helper.rb:42:in `render_with_wicked_pdf'
wicked_pdf (1.1.0) lib/wicked_pdf/pdf_helper.rb:27:in `render'
actionpack (6.1.3.1) lib/action_controller/metal/implicit_render.rb:35:in `default_render'
actionpack (6.1.3.1) lib/action_controller/metal/basic_implicit_render.rb:6:in `block in send_action'
actionpack (6.1.3.1) lib/action_controller/metal/basic_implicit_render.rb:6:in `tap'
actionpack (6.1.3.1) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (6.1.3.1) lib/abstract_controller/base.rb:228:in `process_action'
actionpack (6.1.3.1) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (6.1.3.1) lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport (6.1.3.1) lib/active_support/callbacks.rb:117:in `block in run_callbacks'
actiontext (6.1.3.1) lib/action_text/rendering.rb:20:in `with_renderer'
actiontext (6.1.3.1) lib/action_text/engine.rb:55:in `block (4 levels) in <class:Engine>'
activesupport (6.1.3.1) lib/active_support/callbacks.rb:126:in `instance_exec'
activesupport (6.1.3.1) lib/active_support/callbacks.rb:126:in `block in run_callbacks'
react-rails (2.6.0) lib/react/rails/controller_lifecycle.rb:31:in `use_react_component_helper'
activesupport (6.1.3.1) lib/active_support/callbacks.rb:126:in `block in run_callbacks'
activesupport (6.1.3.1) lib/active_support/callbacks.rb:137:in `run_callbacks'
actionpack (6.1.3.1) lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack (6.1.3.1) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (6.1.3.1) lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
activesupport (6.1.3.1) lib/active_support/notifications.rb:203:in `block in instrument'
activesupport (6.1.3.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.1.3.1) lib/active_support/notifications.rb:203:in `instrument'
actionpack (6.1.3.1) lib/action_controller/metal/instrumentation.rb:33:in `process_action'
actionpack (6.1.3.1) lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
activerecord (6.1.3.1) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack (6.1.3.1) lib/abstract_controller/base.rb:165:in `process'
actionview (6.1.3.1) lib/action_view/rendering.rb:39:in `process'
actionpack (6.1.3.1) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (6.1.3.1) lib/action_controller/metal.rb:254:in `dispatch'
actionpack (6.1.3.1) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (6.1.3.1) lib/action_dispatch/routing/route_set.rb:33:in `serve'
actionpack (6.1.3.1) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (6.1.3.1) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.1.3.1) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.1.3.1) lib/action_dispatch/routing/route_set.rb:842:in `call'
railties (6.1.3.1) lib/rails/engine.rb:539:in `call'
railties (6.1.3.1) lib/rails/railtie.rb:207:in `public_send'
railties (6.1.3.1) lib/rails/railtie.rb:207:in `method_missing'
actionpack (6.1.3.1) lib/action_dispatch/routing/mapper.rb:20:in `block in <class:Constraints>'
actionpack (6.1.3.1) lib/action_dispatch/routing/mapper.rb:49:in `serve'
actionpack (6.1.3.1) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (6.1.3.1) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.1.3.1) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.1.3.1) lib/action_dispatch/routing/route_set.rb:842:in `call'
warden (1.2.8) lib/warden/manager.rb:36:in `block in call'
warden (1.2.8) lib/warden/manager.rb:34:in `catch'
warden (1.2.8) lib/warden/manager.rb:34:in `call'
rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.3) lib/rack/etag.rb:27:in `call'
rack (2.2.3) lib/rack/conditional_get.rb:27:in `call'
rack (2.2.3) lib/rack/head.rb:12:in `call'
actionpack (6.1.3.1) lib/action_dispatch/http/permissions_policy.rb:22:in `call'
actionpack (6.1.3.1) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
rack (2.2.3) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.3) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (6.1.3.1) lib/action_dispatch/middleware/cookies.rb:689:in `call'
activerecord (6.1.3.1) lib/active_record/migration.rb:601:in `call'
actionpack (6.1.3.1) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (6.1.3.1) lib/active_support/callbacks.rb:98:in `run_callbacks'
actionpack (6.1.3.1) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (6.1.3.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.1.3.1) lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
actionpack (6.1.3.1) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
web-console (4.1.0) lib/web_console/middleware.rb:132:in `call_app'
web-console (4.1.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (4.1.0) lib/web_console/middleware.rb:17:in `catch'
web-console (4.1.0) lib/web_console/middleware.rb:17:in `call'
actionpack (6.1.3.1) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (6.1.3.1) lib/rails/rack/logger.rb:37:in `call_app'
railties (6.1.3.1) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (6.1.3.1) lib/active_support/tagged_logging.rb:99:in `block in tagged'
activesupport (6.1.3.1) lib/active_support/tagged_logging.rb:37:in `tagged'
activesupport (6.1.3.1) lib/active_support/tagged_logging.rb:99:in `tagged'
railties (6.1.3.1) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.2) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (6.1.3.1) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
request_store (1.5.0) lib/request_store/middleware.rb:19:in `call'
actionpack (6.1.3.1) lib/action_dispatch/middleware/request_id.rb:26:in `call'
rack (2.2.3) lib/rack/method_override.rb:24:in `call'
rack (2.2.3) lib/rack/runtime.rb:22:in `call'
rails_performance (1.0.1) lib/rails_performance/rails/middleware.rb:42:in `call!'
rails_performance (1.0.1) lib/rails_performance/rails/middleware.rb:38:in `call'
rails_performance (1.0.1) lib/rails_performance/rails/middleware.rb:17:in `call!'
rails_performance (1.0.1) lib/rails_performance/rails/middleware.rb:9:in `call'
actionpack (6.1.3.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.1.3.1) lib/action_dispatch/middleware/static.rb:24:in `call'
rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
actionpack (6.1.3.1) lib/action_dispatch/middleware/host_authorization.rb:98:in `call'
rack-mini-profiler (2.3.0) lib/mini_profiler/profiler.rb:373:in `call'
webpacker (4.2.2) lib/webpacker/dev_server_proxy.rb:23:in `perform_request'
rack-proxy (0.6.5) lib/rack/proxy.rb:57:in `call'
railties (6.1.3.1) lib/rails/engine.rb:539:in `call'
puma (3.12.6) lib/puma/configuration.rb:227:in `call'
puma (3.12.6) lib/puma/server.rb:706:in `handle_request'
puma (3.12.6) lib/puma/server.rb:476:in `process_client'
puma (3.12.6) lib/puma/server.rb:334:in `block in run'
puma (3.12.6) lib/puma/thread_pool.rb:135:in `block in spawn_thread' 
igorkasyanchuk commented 3 years ago

Hello, this is very strange. Unfortunately I can't investigate this issue because on vacation. Maybe someone can take a look or you can fix the issue.

existentialmutt commented 3 years ago

OK, thanks for letting me know!

igorkasyanchuk commented 3 years ago

image

not sure why you have this issue.

Can you try to add gem in the blank app and see it works for you?

for me on few projects all works well. You can see from the screenshot method is present in helper in this helper included in the controller.

igorkasyanchuk commented 1 year ago

too old issue, no help ((