Fixing undefined method 'devise' When Using devise_token_auth in Rails 8

While working on a Rails 8 project that used Devise together with devise_token_auth, I ran into a frustrating error when running commands…