annotate_models
annotate_models copied to clipboard
Rails 8.0 Support
The gem should work with Rails 8.0
Commands
gem install rails
rails new example
cd example
bundle add annotate --version '3.2.0'
Outcome:
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Could not find compatible versions
Because annotate >= 3.2.0 depends on activerecord >= 3.2, < 8.0
and rails >= 8.0.0 depends on activerecord = 8.0.0,
annotate >= 3.2.0 is incompatible with rails >= 8.0.0.
So, because Gemfile depends on rails ~> 8.0.0
and Gemfile depends on annotate = 3.2.0,
version solving has failed.
Version
- annotate version 3.2.0
- rails version 8.0.0
- ruby version 3.3.5
PR: https://github.com/ctran/annotate_models/pull/1033
Per this thread, it seems like this gem might not be maintained anymore, and many people are moving to the fork https://github.com/drwl/annotaterb (annotaterb), which is already compatible with Rails 8.
Note, however, that the annotaterb fork is not an exact drop-in replacement. There are some changes in the syntax of the CLI command(s), and I found that many of the CLI options seem not to work for me, and instead I must specify the options that I want via a .annotaterb.yml config file, rather than via command line flags.
@davidrunger thx for pointing this. The maintainer of this project should then put it in archive mode and let the community know where to go...
@spaquet Correct, I didn't know that this gem was abandonware. Please @ctran, @Adeynack, @n-rodriguez, @lovro-bikic can any of you confirm if that is the case so we can all move on?
@aitor Hi there! Actually I'm not a maintainer of annotate_model (only a contributor) but I've finally switched to https://github.com/drwl/annotaterb. It works and seems to be well maintained 👍 So feel free to move on it.
Dear @aitor : Same as @n-rodriguez: I contributed only 2 PRs here. I am not a maintainer. I learn right now of this, as you are posting those. 😮
Thanks @aitor for the suggestion. I will give it a look ASAP.
It's not working here with a recent update.
Let me know if you need further information.
~/w/t/flow_climate (main ± ) ∫ annotate --models [11:32:20]
/Users/celsomartins/.rvm/gems/ruby-3.3.6@flow_climate/gems/annotate-2.6.5/bin/annotate:3:in `<top (required)>': undefined method `exists?' for class File (NoMethodError)
unless File.exists?('./Rakefile') || File.exists?('./Gemfile')
^^^^^^^^
Did you mean? exist?
from /Users/celsomartins/.rvm/gems/ruby-3.3.6@flow_climate/bin/annotate:25:in `load'
from /Users/celsomartins/.rvm/gems/ruby-3.3.6@flow_climate/bin/annotate:25:in `<main>'
from /Users/celsomartins/.rvm/gems/ruby-3.3.6@flow_climate/bin/ruby_executable_hooks:22:in `eval'
from /Users/celsomartins/.rvm/gems/ruby-3.3.6@flow_climate/bin/ruby_executable_hooks:22:in `<main>'
@celsoMartins switch to https://github.com/drwl/annotaterb 😏
OMG.
Okay, I'll do that.
Thanks.
Got error for the new rails
Because annotate >= 3.2.0 depends on activerecord >= 3.2, < 8.0 and rails >= 8.0.1 depends on activerecord = 8.0.1, annotate >= 3.2.0 is incompatible with rails >= 8.0.1. So, because Gemfile depends on rails ~> 8.0.1 and Gemfile depends on annotate = 3.2.0, version solving has failed.
Working fine with the fixes
` class File class << self alias exists? exist? unless method_defined?(:exists?) end end
unless defined?(Fixnum) Fixnum = Integer end
unless defined?(Bignum) Bignum = Integer end `
@bublik switch to https://github.com/drwl/annotaterb 😏
@bublik switch to https://github.com/drwl/annotaterb 😏
It works like a charm, thanks a lot @n-rodriguez ! 🙇 🙌