-
Notifications
You must be signed in to change notification settings - Fork 23
Installation on Rails 2.x
To install the gem, put this in config/environment.rb
;
config.gem 'navvy'
and run;
rake gems:install
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
.
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
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
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.