Why am i getting 'uninitialized constant Mail::TestMailer' error with "Rails 6.1.5 & Ruby 3.1.0" while working without problems "Rails 6.1.5 & Ruby 3.0.1" ?
Rails 6.1.5: uninitialized constant Mail::TestMailer
1.6k views Asked by togi At
3
There are 3 answers
0

I had similar issue, after debugging and troubleshooting. I made changes to the Rails version to 6.1.1.4 instead of 6.1.7. The I got similar error stating that it could not load some .rb files from the mail gem. What I did was to give them the read permission to others.
chmod 644 <ruby-file-in-mail-gem>.rb
and the application loaded fine after that.
Found following from NEWS for Ruby 3.1.0.
So, i just added next 3 lines into GemFile. It worked fine.