Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 593079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:48:26+00:00 2026-05-13T15:48:26+00:00

I am trying to use the Whenever plugin for rails to perform a model

  • 0

I am trying to use the Whenever plugin for rails to perform a model process at certain times. My schedule.rb is as follows:

 every 1.day, :at => '5:30 am' do
    runner "User.mail_out"
  end

My model is as follows:

class User < ActiveRecord::Base

  acts_as_authentic

  def mail_out

    weekday = Date.today.strftime('%A').downcase

    @users = find(:conditions => "#{weekday}sub = t")

    @users.each { |u| UserMailer.deliver_mail_out(u)}   


  end

end

When I try to run the script/runner -e development “User.mail_out” command, I get the following error:

/var/lib/gems/1.8/gems/rails-2.3.5/lib/commands/runner.rb:48: undefined method `mail_out' for #<Class:0xb708bd50> (NoMethodError)
    from (eval):1
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `eval'
    from /var/lib/gems/1.8/gems/rails-2.3.5/lib/commands/runner.rb:48
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from script/runner:3

Can anyone point out what is going wrong? Also how can I manually invoke the mail_out process (from command line) to test the functionality of my mailing system.

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:48:26+00:00Added an answer on May 13, 2026 at 3:48 pm

    You’re getting that error because you’ve defined the mail_out method as an instance method instead of a class method. To fix it, change the method definition line to (add self.):

    def self.mail_out
    

    To test it from the command line, do something like this:

    script/runner "User.mail_out"
    

    You might want to puts or print something so you get some feedback on what happened.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use the Whenever plugin for rails to perform a model
I am trying to use the Whenever plugin for rails to perform a model
I've been trying to use the 'twitter_oauth' gem with my rails application but whenever
I'm trying to use std::string instead of char* whenever possible, but I worry I
I'm trying to use a MySQL database to save player information, but whenever there
I am trying to develop a firefox plugin, which should be executed, whenever a
I'm trying to use pyinotify to alert me whenever files are deleted, but I
I am trying to use Selenium RC but i keep getting this error whenever
I'm trying to use FancyBox for a gallery of 36 images, but whenever I
I'm trying to use JODConverter on top of jetty and sinatra. Whenever I fire

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.