下面是我的environment.rb文件
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: 'atomambition@gmail.com',
password: '********'
}
我已将我的gmail密码放入**部分。但当我进行rake:db迁移时,它在environment.rb文件上显示错误,告诉我
7:in'>'。
请帮帮我。我正在我的rails应用程序中创建邮件功能。我被卡住了。
此配置代码不应包含在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: 'atomambition@gmail.com',
password: '********'
}
# remainder of configuration
end