저는이 문제를 완전히 해결하지 못했습니다. 레일 3.2.12 응용 프로그램에서 나는 ActionMailer 된 이메일을 보내려고이 예외를 받고 있어요 : 나는 아래로 최소한 내 우편물을 제거했습니다Rails 3에서 ActionMailer를 사용할 때 "잘못된 인수 유형"예외가 발생했습니다.
TypeError: wrong argument type Class (expected Module) from /Users/trcull/.rvm/gems/[email protected]/gems/actionpack-3.2.12/lib/abstract_controller/helpers.rb:153:in `include'
. 그것은 심지어 메일을 보내지 않습니다! 전체 내용은 다음과 같습니다.
class SupportNewUserMailer < ActionMailer::Base
def new_user
puts "hi"
end
end
심각하게 그게 전부입니다. 그런 다음 레일즈 콘솔에서 이렇게 호출하여 예외를 얻습니다.
1.9.3p125 :001 > SupportNewUserMailer.new_user
여기에 무슨 일이 일어나는지 알지 못합니다. 나는 동일한 응용 프로그램에 다른 우편물을 가지고 있으며 잘 작동합니다.
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.smtp_settings = {
:authentication => :plain,
:address => "smtp.mailgun.org",
:port => 587,
:domain => "redacted",
:user_name => "redacted",
:password => "redacted"
}
PS :
또한, 경우에 그들이 여기 개발에 내 구성입니다, 관련된 예, 클래스 메소드 (워드 프로세서하지를 말하더라도)로 선언하고 같은를 얻을 시도 결과 :
class SupportNewUserMailer < ActionMailer::Base
def self.new_user
puts "hi"
end
end
수익률 :
TypeError: wrong argument type Class (expected Module) from /Users/trcull/.rvm/gems/[email protected]/gems/actionpack-3.2.12/lib/abstract_controller/helpers.rb:153:in `include'
PPS : 아니, 그것은을 찾는 문제가되지 않습니다 수업. 나는이에 선언을 변경하는 경우 (참고, 더 이상 :: 자료 ActionMailer에서 상속 없음) : 예상대로
class SupportNewUserMailer
def self.new_user
puts "hi"
end
end
은 그 때 나는 오류없이 잘 호출 할 수 있으며 화면에 "안녕하세요"인쇄 :
프로그램에서 'include'를 사용 했습니까? 그런 다음 보여주십시오. ** TypeError : 잘못된 인수 유형 클래스 (예상 모듈) ** 분명히 당신이'include' 섹션에서 클래스 이름을 사용했다는 것을 말합니다. –