0

I have a rather strange problem. I have an app mounted on rails by "rvm use 2.6.2@rails6.1.4". Apparently everything works correctly in production environment, except for sending emails. The strange thing is that from development mode it works correctly, but in production mode it returns the following error:

NameError (uninitialized constant Mail::TestMailer)

I have already tried completely reinstalling all the gems including the rvm. The problem persists the same.

The web app runs on top of Apache/Phusion Passenger on Centos 8 Stream.

Please, I need guidance on it, since I am totally stuck with my project.

Completely reinstall gems, update gems to latest versions, disable firewall, disable SELinux

Mandres
  • 63
  • 7
  • Can you make sure you don't have a class named Mail in your code? – Dave Jan 13 '23 at 09:00
  • Have your specified gem "mail" for your environment? – Dave Jan 13 '23 at 09:03
  • does this help? https://stackoverflow.com/questions/71851775/rails-6-1-5-uninitialized-constant-mailtestmailer – Dave Jan 13 '23 at 09:13
  • I didn't have the "mail" gem inside the Gemfile. After placing this gem, I get the following error: `App 45512 output: Error: The application encountered the following error: cannot load such file -- /usr/local/rvm/gems/ruby-2.6.2@rails6.1.4/gems/mail-2.8.0/lib/mail/fields.rb (LoadError)` I tried to open the file, it exists and I don't see problems with the permissions... – Mandres Jan 13 '23 at 11:07
  • I don't have a class called Mail... where should this class be?, who should it inherit from? – Mandres Jan 13 '23 at 11:08
  • I meant there should no be a custom class with name "Mail" as it can conflict – Dave Jan 13 '23 at 11:09
  • I was looking at your suggestion from another post... do you think it is convenient to change the version of the gems? – Mandres Jan 13 '23 at 11:09
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/251115/discussion-between-mandres-and-dave). – Mandres Jan 13 '23 at 11:12

0 Answers0