2014-03-13 2 views
0

매우 이상한 문제가 있습니다.ActionMailer :: Base Not Loading smtp_settings

내 /config/environments/production.rb 파일은 다음 =>

내가 응용 프로그램을 다시 시작했습니다
ActionMailer::Base.smtp_settings = { 
:address => 'smtp.sendgrid.net', 
:port  => 587, 
:domain => "domain.com", 
:user_name => "username", 
:password => "password", 
:authentication => 'plain', 
:enable_starttls_auto => true } 

(현재 사용 여객 및 Nginx에)있다,하지만 난 레일 콘솔에 갈 때 내가 얻을 팔로우 =>

[30] pry(main)> ActionMailer::Base.smtp_settings 
{ 
      :address => "localhost", 
       :port => 25, 
       :domain => "localhost.localdomain", 
      :user_name => nil, 
      :password => nil, 
     :authentication => nil, 
:enable_starttls_auto => true 
} 

누구나 쉽게 경험할 수 있습니까? 이것은 내가 이메일을 보낼 수없는 근본 문제이다. 적절한 설정을로드하지 않기 때문에 연결이 거부됩니다. 어떤 생각을하고 있어도 벽 소리가 들리 네요> <

+1

'rails c production'을 사용하여 프로덕션 환경에서 콘솔을 여십니까? 콘솔의'Rails.env'는 무엇을 반환합니까? – spickermann

+0

아마도 불필요하지만 여전히 AM : Base에 고정되어있는 것이 아니라 실제 레일스 구성의 일부로 구성을 정의하는 것이 좋습니다. http://guides.rubyonrails.org/action_mailer_basics.html#example-action-mail-configuration – sevenseacat

답변

1

레일 모드 콘솔을 사용하고 있는지 확인하십시오.

rails console production 
+0

프로덕션 환경에서 자동으로 별칭을 생성하기 위해 별칭을 만들었습니다. 상자를 옮겼지만 별칭을 다시 추가하지 않았습니다 :) 가리키는 주셔서 감사합니다. 나가! – Tony