2013-12-10 34 views
0

下面是我的environment.rb文件中錯誤的environment.rb文件中的配置下(Ruby on Rails的)

require File.expand_path('../application', __FILE__) 

Wiyo::Application.initialize! 

config.action_mailer.smtp_settings = { 
    address: "smtp.gmail.com", 
    port: 587, 
    domain: "example.com", 
    authentication: "plain", 
    enable_starttls_auto: true, 
    user_name: '[email protected]', 
    password: '********' 
} 

我在**節把我的Gmail密碼。但是當我做耙:db遷移,它顯示錯誤environment.rb文件告訴我

7:in'>'。

請幫幫我。我在我的Rails應用程序中創建郵件功能。我被卡住了。

+0

對於它的價值,您提供的代碼沒有任何問題,據我所知。請發佈實際的錯誤消息。 –

回答

0

該配置代碼應該包括在environments.rb中,其中不是config全局本地化爲環境特定config/environments中找到的配置文件。嘗試將此代碼添加到適當的文件中:

# config/environment/development.rb 
Wiyo:::Application.configure do 

    config.action_mailer.smtp_settings = { 
    address: "smtp.gmail.com", 
    port: 587, 
    domain: "example.com", 
    authentication: "plain", 
    enable_starttls_auto: true, 
    user_name: '[email protected]', 
    password: '********' 
    } 

    # remainder of configuration 

end 
+0

'>'是我得到的錯誤。 – atomaprchya

+0

那麼?你有沒有嘗試我的建議? – zeantsoi

+0

我解決了這個問題。我把這些信息放在開發中。謝謝 – atomaprchya