I cloned an old project of mine (live on production) from GitHub to my new MacBook running macOS v11 (Big Sur). I wanted to work on new features and updates, but I keep getting some migration errors.
As far as I know, we should not delete any migration file. So what is the best practice to fix these errors?
- Should I delete, edit the migration files that causes issue?
- Should I delete the relevant gems along with migration files and install fresh?
- Any other suggestion?
Command (as root):
bin/rails db:migrate RAILS_ENV=development
Output:
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
== 20171118122416 AddTaggingsCounterCacheToTags: migrating ====================
-- add_column(:tags, :taggings_count, :integer, {:default=>0})
-> 0.0521s
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:
uninitialized constant AddTaggingsCounterCacheToTags::ActsAsTaggableOn