Why is autoload failing to load files for gems

只谈情不闲聊 提交于 2019-12-01 12:34:09

问题


I am trying to read emails in ruby using this gmail gem.

When I require 'gmail' in IRB or in a script, I get this error:

/Library/Ruby/Gems/1.8/gems/gmail-0.4.0/lib/gmail.rb:70:in connect_with_proper_client': no such file to load -- gmail/client (LoadError) from /Library/Ruby/Gems/1.8/gems/gmail-0.4.0/lib/gmail.rb:48:in new

This is happening because autoload cannot file the 'gmail/client' file.

When I add require 'gmail/client' manually, the problem goes away till the next autoload call. This solution is unacceptable because I cannot anticipate which files to add in advance.

I found a similar question, however it didn't remedy my problem.

来源:https://stackoverflow.com/questions/12231134/why-is-autoload-failing-to-load-files-for-gems

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!