简体   繁体   English

Rails 6 和操作邮箱设置

[英]Rails 6 and action mailbox setup

I've recently upgraded to ruby 2.6.0p0 and rails 6.0.2.1 .我最近升级到ruby 2.6.0p0 and rails 6.0.2.1 And previously I had ruby 2.3 and rails 5.2 .之前我有ruby 2.3 and rails 5.2

When I open up existing apps and just bundle update and then rails s everything is working just fine:当我打开现有的应用程序并只bundle update然后rails s一切正常:

=> Booting Puma
=> Rails 6.0.2.1 application starting in development 
=> Run `rails server --help` for more startup options
Puma starting in single mode...
* Version 3.12.0 (ruby 2.6.0-p0), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development

But when I try to implement the new action mailbox feature by entering this initially rails action_mailbox:install it returns the following error, this same error occurs if I enter this rails action_text:install .但是,当我尝试通过最初输入这个rails action_mailbox:install来实现新的 操作邮箱功能时,它返回以下错误,如果我输入这个rails action_text:install会发生同样的错误。

rails aborted!
Don't know how to build task 'action_mailbox:install' (See the list of available tasks with `rails --tasks`)

Any ideas why this is happening?任何想法为什么会发生这种情况?

If that task can't be found, then it's generally one of two things:如果找不到该任务,则通常是以下两种情况之一:

  1. Your terminal is using a different version of rails when you run the script (maybe try bundle exec rails action_mailbox:install ?)运行脚本时,您的终端正在使用不同版本的 rails(也许尝试bundle exec rails action_mailbox:install ?)
  2. Some pieces were missed during the Upgrade Task that aren't requiring the new action mailbox tasks.升级任务期间遗漏了一些不需要新操作邮箱任务的部分。

I had the same issue.我遇到过同样的问题。 Be sure, you require action_mailbox/engine in application.rb确定,您需要在application.rbapplication.rb action_mailbox/engine

require 'action_mailbox/engine'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM