brentd / xray-rails

☠️ A development tool that reveals your UI's bones
MIT License
1.22k stars 79 forks source link

Fix "undefined method safe_append=" on Ruby 3.0.0 #108

Closed mattbrictson closed 1 month ago

deepakmahakale commented 3 years ago

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

mattbrictson commented 3 years ago

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"
deepakmahakale commented 3 years ago

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

deepakmahakale commented 3 years ago

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? %> 
evolve2k commented 2 years ago

It would be great to get this moving!

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

graaff commented 2 years ago

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/

goofansu commented 1 year ago

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

mamantoha commented 4 months ago

Hi @brentd. Will you be merging this PR?

brentd commented 1 month ago

Merged. I will cut a release in the next few days. Sorry for the long hiatus!