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

  • Home
  • SEARCH
  • 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 6066755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:32:04+00:00 2026-05-23T09:32:04+00:00

I am using resque in my application for delayed jobs, where i cant send

  • 0

I am using resque in my application for delayed jobs, where i cant send emails & sms to bulk number of users asynchronously. And the data is stored in mongodb, mongoid is the ODM connects rails & mongo.

My mongoid model looks like this

class Item
  include Mongoid::Document
  include Geo::LocationHelper 

  field :name, :type => String
  field :desc, :type => String

  #resque queue name
  @queue = :item_notification

  #resque perform method
  def self.perform(item_id)
     @item = Item.find(item_id)

  end

end

I can able to add jobs to resque, i have verified using resque-web. Whenever i start an resque-worker

QUEUE=item_notification rake resque:work

i got the uninitialized constant Item , since i am using resque as rails gem and starting rake in rails root, i believe my mongoid models should be loaded.

After digging lot, i found that we can explicitly ask rake to load the environment by

  QUEUE=item_notification rake environment resque:work

but now also i got the same error uninitialized constant Item

can someone help me out?

and my

  • 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-23T09:32:04+00:00Added an answer on May 23, 2026 at 9:32 am

    Actually, its a problem in dev environment. after adding this line to into resque.rake task file

    # load the Rails app all the time
    namespace :resque do
      puts "Loading Rails environment for Resque"
      task :setup => :environment
      ActiveRecord::Base.send(:descendants).each { |klass|  klass.columns }
    end
    

    it works fine

    The code taken from GitHub-Resque-Wiki

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

Sidebar

Related Questions

Im using Resque + RedisToGo for my background jobs. I am having trouble running
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
I was writing a Blog like application Using Rails3/Mongoid, and now trying to use
My application checks a number of domains to see if they are valid (approx
I'm using Rails with resque. The sleep time is the seconds of a worker
I'm using Rails with Resque. I know the command of redis-cli is: expire key
My application is able to send the input of several textfields to a PHP
I am using resque, resque-scheduler gems in my rails app. To monitor the working
I am using paperclip to upload and display images in my Rails application. <%
I'm trying to POST some data as if I was using FORM on HTML

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.