[LRUG] out of char range (RangeError)

aidy lewis aidy.lewis at googlemail.com
Thu Feb 14 08:52:37 PST 2008


Hi,

I am trying to use Gmailer to extract and email msg body, but I am getting a
RangeError

My code is:

def check_purchase_email
  @g = nil
  @msg = nil
  GMailer.connect(:username=>'testautomated6 at googlemail.com',:password=>'password123')
do |@g|
    @g.messages(:standard=>'all', :read => false).each_msg {|@msg|
     puts "subject: " + @msg.subject
     puts "from:    " + @msg.sender
     puts "snippet: " + @msg.snippet
     puts @msg.body
  }
  end
  @g.disconnect
end


the error is:

c:/ruby/lib/ruby/site_ruby/1.8/gmailer.rb:401:in `chr': 9660 out of char
range (RangeError)

The offending line of code is:

when /\A#(\d+)\z/n         then Integer($1).chr

Could anyone suggest a fix?

Aidy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20080214/0dea6a1b/attachment-0003.html>


More information about the Chat mailing list