hi all,
       i want to know how to use gmailer in rails

sudo apt-get install libopenssl-ruby
gem install GMailer

It also req. Python library
You can use as : foo = GMailer.connect("cpjolicoeur", "mypassword")
This is procedure :

require 'gmailer'

GMailer.connect(name,pwd) do |g|
  g.messages(:label=>"my_label") do |ml|
        puts "Total # of conversations of my_label = " +

  #get contact
  g.fetch(:contact=>"freq").each do |item|
    puts "Name: #{item['name']} Email: #{item['email']}"

  #send message
  # 'From' default account
    :to => ",,",
    :cc => "",
    :subject => "Hello There!",
    :body => "Hi...\n\nBlah blah blah~~...",
    :files => ["./my_pic.jpg", "./my_cv.txt"])

  # multiple verified email addresses and choose one 'From:' email
    :from => "",
    :to => ",,",
    :cc => "",
    :subject => "Hello There!",
    :body => "Hi...\n\nBlah blah blah~~...",
    :files => ["./my_pic.jpg", "./my_cv.txt"])

  # update_preference
    :signature=>'This is a signature',
    :display_name=>'Display Name')

  # get preference
  pref = g.preference
  puts "Language:#{pref['display_language']}, Page

  #creating new labels

  #renaming existing labels

  #deleting labels

  #applying a label to a message

  #removing a label from a message

  #apply star to a message

  #remove star from a message

  #archive a message

  #unarchive a message

  #mark a message as read

  #mark a message as unread

  #report a message as not spam

  #report a message as not spam

  #move a message to trash

  #move a message from trash to inbox

  #delete a trash message forever

  #delete a spam message forever

  #delete a message forever

  #show original message original(msgid)

  #get labels
  labels = g.labels

  #get messages
  g.messages(:label=>labels[0]).each {|m|
     puts "Subject: #{m.subject} / Snippet: #{m.snippet}"

  #get inbox messages
  g.messages(:standard=>'inbox').each {|m|
     puts "Subject: #{m.subject} / Snippet: #{m.snippet}"

  # fetch with filter :read or :star
  g.messages(:standard=>'all',:read=>false).each {|msg|
     # operations on the message

     puts "subject: " + msg.subject
     puts "from: " + msg.sender
     puts msg.body
     puts msg.original


I have installed gmailer gem.but i got some error when i tried to
my gmail account.i need to get the inbox messages from my gmail
account.but i can't.plzz help me.i got "You have a nil object when you
didn't expect it!
The error occurred while evaluating nil.connection= error".i got tis
eror when i used g.messages line in my code is

require 'rubygems'
require 'gmailer'

class FirstController < ApplicationController

def index
   puts "lllllllllll"
   if GMailer.connect('', 'password')
   puts "CONNECTED"
   GMailer.connect('', 'password') do |g|
   puts "GGGGGGGG enter"
   puts g.inspect
   g.messages(:label => "inbox") do |ml|
       ml.each_msg do |conversation|
             :title => conversation.subject,
             :text => conversation.body,
             :sender => conversation.sender,
             :sender_email => conversation.sender_email,
             :reply_email => (conversation.reply_email.blank?) ?
conversation.sender_email : conversation.reply_email
         count += 1
         puts conversation.archive
      end #connect
  rescue Exception => e
    puts e