Net :: IMAP uninitialized persistent error

I don't really know where to start, but I am (first time) using Net::IMAP

and I get the following error:

NameError in EmailsController#connect
uninitialized constant Net::IMAP

Extracted source (around line #4):

2  
3 def connect
4  imap = Net::IMAP.new('outlook.office365.com')
5  imap.authenticate('LOGIN', '**@**.com', '**')
6  imap.examine('INBOX')
7  @emails = imap.search(["RECENT"])

      

Not really sure what's going on here, I don't need something in mine Gemfile.rb

? Or anything else before I set the variable imap

?

+3


source to share


1 answer


You need require 'net/imap'

the top of the file to bring Net::IMAP

in scope.



+5


source







All Articles