Ruby on rails 用于ni的Rails Puma邮件错误端口
错误: 配置:Ruby on rails 用于ni的Rails Puma邮件错误端口,ruby-on-rails,email,Ruby On Rails,Email,错误: 配置: *telnet smtp.gmail.com 587 ok telnet smtp.gmail.com 25 ok Connection refused - connect(2) for nil port 2 你可以做两件事,希望能解决“拒绝连接”的问题 从中查找您的IP,然后将其放到此行(gmail无法接受localhost:3000) config/environments/development.rb config.action_mailer.default_url_
*telnet smtp.gmail.com 587 ok
telnet smtp.gmail.com 25 ok
Connection refused - connect(2) for nil port 2
你可以做两件事,希望能解决“拒绝连接”的问题
- 从中查找您的IP,然后将其放到此行(gmail无法接受localhost:3000)
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.gmail.com',
port: 587,
domain: 'gmail.com',
user_name: 'rapid.virus.0@gmail.com',
password: '55xxxxxx',
authentication: :plain,
enable_starttls_auto: true
}
- 如果你想使用gmail帐户,你必须把gmail的安全性降低,并打开它,这样你的应用程序才能使用它
config.action_mailer.default_url_options = { :host => 'xxx.xxx.xxx.xxx' }