ctran / annotate_models

Annotate Rails classes with schema and routes info
Other
4.41k stars 598 forks source link

Rails 7, annotate --routes failed #983

Open SimBed opened 1 year ago

SimBed commented 1 year ago

Thanks for the gem. I am just trying it out in Rails 7 after listening to an episode of the Ruby for All podcast where it is referred.

annotate --routes

rake aborted!
Don't know how to build task 'routes' (See the list of available tasks with `rake --tasks`)

This is due to the the rake routes deprecation [need to use rails routes instead]. An issue was raised earlier about the deprecation warning (just gave a warning, but continued to work in Rails 6.0). Now in 7.0 it fails.

Thanks Daniel

Ashley-King commented 1 year ago

A work-around that works for me: create a file in /lib/tasks called routes.rake and add this:

task routes: :environment do
  puts `bundle exec rails routes`
end
AliOsm commented 9 months ago

I'm using devcontainers, I added this line in my setup.sh script:

sudo sed -i 's/rake routes/rails routes/g' /usr/local/rvm/gems/ruby-3.2.2/gems/annotate-3.2.0/lib/annotate/annotate_routes/header_generator.rb

Sorry for the dirtiness :)

ruanltbg commented 7 months ago

Is this repo still being maintained?

cc @ctran @drwl @MrJoy

drwl commented 7 months ago

@ruanltbg Hi, I don't actively maintain this gem anymore, but work on https://github.com/drwl/annotaterb.

ruanltbg commented 7 months ago

Thank you, I will update my gemfile.

bingDBdu commented 4 months ago

A work-around that works for me: create a file in /lib/tasks called routes.rake and add this:

task routes: :environment do
  puts `bundle exec rails routes`
end

It works, but this's that strange, absurd, ridiculous...