Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Installation on Rails 2.x

jeffkreeftmeijer edited this page Sep 13, 2010 · 5 revisions

Installing the gem

To install the gem, put this in config/environment.rb ;

config.gem 'navvy'

and run;

rake gems:install

Requiring Navvy and choosing a database adapter

Now, create an initializer called config/initializers/navvy.rb and include Navvy and the desired database adapter like this;

require 'navvy'
require 'navvy/job/active_record'

Navvy also supports Sequel, DataMapper, MongoMapper and Mongoid. If you want to use those, simply require navvy/job/sequel, navvy/job/data_mapper, navvy/job/mongo_mapper or navvy/job/mongoid.

Creating the database table

If you’re using ActiveRecord of Sequel, you’ll need to create a jobs table in your database. Generate the migration like this;

script/generate navvy --active_record # or -- sequel

Getting the Rake tasks

Navvy has some Rake tasks that make it easy to start the worker or clear your jobs. If you want to use them, just append this to your application’s Rakefile;

begin
  require 'navvy/tasks'
rescue LoadError
  task :navvy do
    abort "Couldn't find Navvy." << 
      "Please run `gem install navvy` to use Navvy's tasks."
  end
end

Done!

Congratulations. You just installed Navvy into your application. You can hop on over to the Getting started guide for more information on how to use Navvy.