brentd / xray-rails

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

calling non-existent method 'pathname' #88

Closed mkamensky closed 4 years ago

mkamensky commented 7 years ago

After installing, my app failed to regenerate assets, with errors such as

undefined method `pathname' for #<#<Class:0x00000039790f2ca8>:0x00000039779e5b28>

As far as I understand, the context provided by sprockets no longer has a pathname method. Replacing the first line of the self.run method in xray/engine.rb to read

path = Pathname.new(context.filename).to_s

solved the problem for me (but I don't really understand what's going on there)

mattbrictson commented 4 years ago

Fixed via #103

2called-chaos commented 4 years ago

@mattbrictson Can we get a release for this fix? I'm using it as a dependency in our "devkit" gem and in gemspecs you can't point to github. Cheers

mattbrictson commented 4 years ago

Hi @2called-chaos, thanks for raising this. I'd like to cut a release but I am not confident that this fix truly ensures Sprockets 4 compatibility. For example if you check out xray-rails @ master today and try to run the test suite, it will fail:

Failure/Error: Dummy::Application.initialize!

Sprockets::Railtie::ManifestNeededError:
  Expected to find a manifest file in `app/assets/config/manifest.js`
  But did not, please create this file and use it to link any assets that need
  to be rendered by your app:

  Example:
    //= link_tree ../images
    //= link_directory ../javascripts .js
    //= link_directory ../stylesheets .css
  and restart your server
# ./spec/dummy/config/environment.rb:5:in `<top (required)>'

I don't want to release a gem that has failing tests.

Would you be able to help with these two issues?