xray-rails
xray-rails copied to clipboard
ActionView::Template::Error - undefined method `pathname'
I installed it, but when loading the page, I get:
Rendered layout layouts/application.html.slim (Duration: 65.6ms | Allocations: 69181)
Completed 500 Internal Server Error in 71ms (ActiveRecord: 4.4ms | Allocations: 73408)
ActionView::Template::Error (undefined method `pathname' for #<#<Class:0x00000001086737a8>:0x0000000108e0ad68 @environment=#<Sprockets::CachedEnvironment:0x7bd4
...
path = context.pathname.to_s
^^^^^^^^^
Did you mean? path_to_image):
xray-rails (0.3.2) lib/xray/engine.rb:58:in `run'
Unfortunately, I think this gem is not fully compatible with sprockets 4.x You can try the master
branch to see if that works for your app (the pathname
issue was addressed in #103 but was never released). Or you can pin your sprockets dependency in your Gemfile to ~> 3.5
, which might work, too.
This gem will probably need to be rewritten (or perhaps reimagined as an npm module) to support the new generation of frontend tools commonly used with Rails, like esbuild, propshaft, webpack, etc. For now, it is pretty much stuck in limbo.
Thanks for explaining this. 🙏
I tried master
, and I also locked sprockets
to ~> 3.5
, but in both cases I receive:
ActionView::Template::Error (undefined method `safe_concat' for {:add_to_stack=>true}:Hash
@virtual_path = "shared/_breadcrumbs";items = local_assigns[:items]; items = items;;@output_buffer = output_buffer || ActiveSupport::SafeBuffer.new; @output_buffer.safe_concat(("<nav aria-label=\"You are here\" id=\"breadcrumbs\"><ol>".freeze));
Sad, sad, sad. I loved xray-rails for many years and was so used to hit Cmd+Shift+X... Anyone knows an alternative? I tried rails-footnotes, but doesn't seem to work either.
Working on rails 6 & 7 with sprockets 4.1
https://github.com/brentd/xray-rails/issues/119