You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Elastic Beanstalk上Rails项目报NameError: uninitialized constant Mail::TestMailer

Elastic Beanstalk部署Rails项目报错:NameError: uninitialized constant Mail::TestMailer

我在Elastic Beanstalk上部署Ruby on Rails项目时遇到以下错误:

NameError: uninitialized constant Mail::TestMailer

参考资料后,我已经在Gemfile中添加并安装了以下3个gem:

gem 'net-smtp', '>= 0.3.3'
gem 'net-imap', '>= 0.1.2'
gem 'net-pop', '>= 0.1.2'

但问题仍未解决,每次执行eb deploy都失败。

环境信息

  • Ruby版本:3.0.5
  • Rails版本:6.1.7

应用邮件器代码

class ApplicationMailer < ActionMailer::Base
  default from: 'from@example.com'
  layout 'mailer'
end

部署错误日志

eb deploy Creating application version archive "app-4523-230109_233425301397". Uploading: [##################################################] 100% Done... 2023-01-09 14:38:30    INFO    Environment update is starting.       2023-01-09 14:38:36    INFO    Deploying new version to instance(s). 2023-01-09 14:40:51    ERROR   Instance deployment failed. For details, see 'eb-engine.log'. 2023-01-09 14:40:53    ERROR   [Instance: i-0e263523f982bac43] Command failed on instance. Return code: 1 Output: Engine execution has encountered an error.. 2023-01-09 14:40:53    INFO    Command execution completed on all instances. Summary: [Successful: 0, Failed: 1]. 2023-01-09 14:40:53    ERROR   Unsuccessful command execution on instance id(s) 'i-0e263523f982bac43'. Aborting the operation. 2023-01-09 14:40:54    ERROR   Failed to deploy application.        

需要更多信息请告知。

内容的提问来源于stack exchange,提问作者user15967487

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.05 08:55:38