Hello,
I have a runner script that is meant to check a mailbox using imap and
insert them into the application. The method I am using to do this was
taken directly off the rails wiki:
require ‘net/imap’ # above the class, not within it
def self.check_mail
imap = Net::IMAP.new(‘localhost’)
imap.authenticate(‘LOGIN’, ‘username’, ‘password’)
imap.select(‘INBOX’)
imap.search([‘ALL’]).each do |message_id|
msg = imap.fetch(message_id,‘RFC822’)[0].attr[‘RFC822’]
MailReader.receive(msg)
#Mark message as deleted and it will be removed from storage when
user session closd
imap.store(message_id, “+FLAGS”, [:Deleted])
end
end
The following is the output I receive when I run the runner script:
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/runner.rb:27:
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:123:in
const_missing': uninitialized constant SSL (NameError) from /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in
const_missing’
from /usr/lib/ruby/1.8/net/imap.rb:204
from
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in require' from /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
require’
from script/…/config/…/app/models/mailer.rb:1
from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in
load' from /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:56:in
require_or_load’
from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:30:in
depend_on' from /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:85:in
require_dependency’
from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:98:in
const_missing' from /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in
const_missing’
from (eval):1
from
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in eval' from /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/runner.rb:27 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
require’
from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
`require’
from script/runner:3
Any ideas?