铁路6.1.5:非初始化的常量邮件:: testmailer

发布于 2025-01-21 10:01:50 字数 112 浏览 4 评论 0原文

为什么我会在“ rails 6.1.5& ruby​​ 3.1.0”的情况下获得“非初始化的常量邮件:: testmailer”错误,而无问题的工作” 6.1.5& ruby​​ 3.0.1”?

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" ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

听闻余生 2025-01-28 10:01:50

The following default gems are now bundled gems.

net-ftp 0.1.3
net-imap 0.2.2
net-pop 0.1.1
net-smtp 0.3.1
matrix 0.4.2
prime 0.1.2
debug 1.4.0

因此,我刚刚将下3行添加到Gemfile中。它运行良好。

gem 'net-smtp' # to send email
gem 'net-imap' # for rspec
gem 'net-pop'  # for rspec

Found following from NEWS for Ruby 3.1.0.

The following default gems are now bundled gems.

net-ftp 0.1.3
net-imap 0.2.2
net-pop 0.1.1
net-smtp 0.3.1
matrix 0.4.2
prime 0.1.2
debug 1.4.0

So, i just added next 3 lines into GemFile. It worked fine.

gem 'net-smtp' # to send email
gem 'net-imap' # for rspec
gem 'net-pop'  # for rspec
仄言 2025-01-28 10:01:50

在调试和故障排除后,我也有类似的问题。我将Rails版本更改为6.1.1.4,而不是6.1.7。我有类似的错误,指出它无法从邮件宝石中加载一些.rb文件。
我所做的是授予他们阅读许可。

chmod 644 <ruby-file-in-mail-gem>.rb

此后加载申请正常。

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.

渔村楼浪 2025-01-28 10:01:50

在服务器上部署代码后,我遇到了同样的问题。
版本详细信息 -

Rails 6.1.5
ruby 3.1.2p20

我只是安装了一个新的宝石,

gem 'net-smtp'

并且问题得到了解决。

I was getting same issue after deploying the code on server.
Version details-

Rails 6.1.5
ruby 3.1.2p20

I just install a new gem as-

gem 'net-smtp'

and issue got resolved.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文