ruby-on-rails Rails未初始化的常量ActionMailer

arknldoa  于 2023-04-08  发布在  Ruby
关注(0)|答案(1)|浏览(157)

我只是设置动作邮件,这一个是默认的,只是在生成邮件后,似乎这里的问题是与ActionMailer本身

class ApplicationMailer < ActionMailer::Base
  default from: 'from@example.com'
  layout 'mailer'
end
uninitialized constant ActionMailer
[98c7cc1a-bc46-4d7c-864e-0fc062867062] /Users/priya/fs-statuspage-api/app/mailers/application_mailer.rb:1:in `<main>'
/Users/priya/.rvm/gems/ruby-3.2.0@fs-statuspage-api/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/priya/.rvm/gems/ruby-3.2.0@fs-statuspage-api/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/priya/.rvm/rubies/ruby-3.2.0/lib/ruby/gems/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:30:in `require'
/Users/priya/fs-statuspage-api/app/mailers/subscriber_mailer.rb:1:in `<main>'
/Users/priya/.rvm/gems/ruby-3.2.0@fs-statuspage-api/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/priya/.rvm/gems/ruby-3.2.0@fs-statuspage-api/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/priya/.rvm/rubies/ruby-3.2.0/lib/ruby/gems/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:30:in `require'
/Users/priya/fs-statuspage-api/app/controllers/subscribers_controller.rb:20:in `create'
/Users/priya/.rvm/gems/ruby-3.2.0@fs-statuspage-api/gems/actionpack-7.0.4.2/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/Users/priya/.rvm/gems/ruby-3.2.0@fs-statuspage-api/gems/actionpack-7.0.4.2/lib/abstract_controller/base.rb:215:in `process_action'
/Users/priya/.rvm/gems/ruby-3.2.0@fs-statuspage-api/gems/actionpack-7.0.4.2/lib/action_controller/metal/rendering.rb:53:in `process_action'
/Users/priya/.rvm/gems/ruby-3.2.0@fs-statuspage-api/gems/actionpack-7.0.4.2/lib/abstract_controller/callbacks.rb:234:in `block in process_action'
/Users/priya/.rvm/gems/ruby-3.2.0@fs-statuspage-api/gems/activesupport-7.0.4.2/lib/active_support/callbacks.rb:107:in `run_callbacks'
/Users/priya/.rvm/gems/ruby-3.2.0@fs-statuspage-api/gems/actionpack-7.0.4.2/lib/abstract_controller/callbacks.rb:233:in `process_action'
/Users/priya/.rvm/gems/ruby-3.2.0@fs-statuspage-api/gems/actionpack-7.0.4.2/lib/action_controller/metal/rescue.rb:22:in `process_action'
/Users/priya/.rvm/gems/ruby-3.2.0@fs-statuspage-api/gems/actionpack-7.0.4.2/lib/action_controller/metal/instrumentation.rb:67:in `block in process_action'
/Users/priya/.rvm/gems/ruby-3.2.0@fs-statuspage-api/gems/activesupport-7.0.4.2/lib/active_support/notifications.rb:206:in `block in instrument'
/Users/priya/.rvm/gems/ruby-3.2.0@fs-statuspage-api/gems/activesupport-7.0.4.2/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/Users/priya/.rvm/gems/ruby-3.2.0@fs-statuspage-api/gems/activesupport-7.0.4.2/lib/active_support/notifications.rb:206:in `instrument'
/Users/priya/.rvm/gems/ruby-3.2.0@fs-statuspage-api/gems/actionpack-7.0.4.2/lib/action_controller/metal/instrumentation.rb:66:in `process_action'
/Users/priya/.rvm/gems/ruby-3.2.0@fs-statuspage-api/gems/actionpack-7.0.4.2/lib/action_controller/metal/params_wrapper.rb:259:in `process_action'
ttcibm8c

ttcibm8c1#

您似乎忘记了在config/application.rb中需要action_mailer

相关问题