xray-rails icon indicating copy to clipboard operation
xray-rails copied to clipboard

Fix "undefined method safe_append=" on Ruby 3.0.0

Open mattbrictson opened this issue 4 years ago • 8 comments

mattbrictson avatar Jan 02 '21 21:01 mattbrictson

Any updates on this one? xray-rails is breaking on ruby 3.0

deepakmahakale avatar Mar 05 '21 05:03 deepakmahakale

Any updates on this one? xray-rails is breaking on ruby 3.0

I'm using this branch on a Ruby 3.0.0 project and it seems to work. I am reluctant to merge this because CI is broken so I can't be sure it works on other versions of Ruby. Unfortunately I don't have time to work on fixing CI or tending to the other backlog of issues that need to be addressed before cutting a new release.

For now you can depend on this branch directly, like this:

gem "xray-rails", git: "https://github.com/brentd/xray-rails.git", branch: "bugs/ruby-3.0.0"

mattbrictson avatar Mar 07 '21 03:03 mattbrictson

Can we please release this version? Anything I can do to help?

deepakmahakale avatar Nov 26 '21 21:11 deepakmahakale

The fix I am using xray-rails

Ruby 3.0.1 Rails 6.1.4

Gemfile

gem "xray-rails", git: "https://github.com/brentd/xray-rails.git", branch: "bugs/ruby-3.0.0"

app/views/layouts/application.html.erb

<%= javascript_include_tag 'xray', nonce: true if Rails.env.development? %>
<%= stylesheet_link_tag 'xray', nonce: true if Rails.env.development? %> 

For rails 7 esbuild

You may need to change this to:

app/views/layouts/application.html.erb

<%= javascript_include_tag 'xray', nonce: true, "data-turbo-track": "reload", defer: true if Rails.env.development? %>
<%= stylesheet_link_tag 'xray', nonce: true if Rails.env.development? %> 

deepakmahakale avatar Nov 26 '21 21:11 deepakmahakale

It would be great to get this moving!

The main blocker seems to be that the build is not passing.

evolve2k avatar Jul 20 '22 09:07 evolve2k

The fix in this PR only works on Ruby 2.7+. If compatibility with older, unsupported, ruby versions is required then the ruby2_keywords method should be used. See https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/

graaff avatar Sep 19 '22 12:09 graaff

Fixed my problem with this branch. I confirm it works on Ruby 3.2.2 and Rails 7.0.4.3.

goofansu avatar Jun 03 '23 08:06 goofansu