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