我有一个RoR应用程序,它使用gmail gem从我的收件箱中读取电子邮件。我已经部署到Heroku,一切正常,除了连接到Gmail。Gmail :: Client :: AuthorizationError仅适用于Heroku上的Rails应用程序的生产
在我的本地机器上连接时没有问题(在允许访问不太安全的应用程序之后)。
使用基本的gmail登录方法;
Gmail.connect!('[email protected]','password')
仅在生产中出现以下错误。
Gmail::Client::AuthorizationError: Couldn't login to given Gmail account: [email protected] (Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure))
然后我会去https://www.google.com/accounts/DisplayUnlockCaptcha(如其他答案建议),它会工作的优良短的时间内,然后突然停止工作了。
我使用Ruby V2.4.1,回报率V5.1.1和Gmail的宝石v0.6.0(https://github.com/gmailgem/gmail)
任何帮助将是巨大的。
啊,这是有道理的,谢谢!我会研究一些不同的托管选项。 –