在Rails 3.2.11应用程序中未初始化的常量错误

问题描述:

这在Rails 2.3.11中起作用。我升级了应用程序到Ruby 2.0.0和Rails 3.2.11。除了我的支票邮件之外,一切都正常。在Rails 3.2.11应用程序中未初始化的常量错误

在check_mailings_controller.rb:

class CheckMailingsController < ApplicationController 
    ... 
    def send_mail 
    CheckEmail.send_check_mail 
    ... 
    end 
end 

在/lib/check_email.rb:

class CheckEmail 
    def self.send_check_mail 
    ... 
    end 
end 

该错误消息我得到:

uninitialized constant CheckMailingsController::CheckEmail 

应该不是类应用程序启动时初始化?

感谢您的帮助。

只需添加

​​

CheckMailingsController.rb文件的顶部。