Rails + batch jobs

Hey,

I’m wondering how to run a batch job on a rails server. And would this
be possible on a shared hosting like bluehost? what about capistrano?

thnx in advance,
DP

Hi Daan,
If your trying to run a job that will need to be run from time to
time manually, then you should write a rake task and put it in your
lib/tasks/ directory. If your trying to run something automated then
you need to look at BackgroundRB [1] or RailsCron[2]. Note that
RailsCron is no longer supported, but I still like it better than
BackgroundRB.

Good Luck,
Rob K.

[1] http://backgroundrb.rubyforge.org/
[2] http://svn.kylemaxwell.com/not_supported/rails_cron/trunk/README

Hey,

I tried installing backgroundrb by following the Readme, but i always
get errors when i try to start up the server. I’ve installed Slave
1.0.0, Daemons 1.0.3 and the plugin from the bgrb site.

gr
Daan P.

This is the error i get
rake backgroundrb:start --trace
(in E:/RailsProjecten/EigenhomeProjecten/eigenhome_BackgrounDRB)
** Invoke backgroundrb:start (first_time)
** Execute backgroundrb:start
rake aborted!
Exec format error -
E:/RailsProjecten/EigenhomeProjecten/eigenhome_BackgrounDRB/
config/…/script/backgroundrb start
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_supp
ort/core_ext/kernel/agnostics.rb:7:in ' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_supp ort/core_ext/kernel/agnostics.rb:7:in
./vendor/plugins/backgroundrb/tasks/backgroundrb_tasks.rake:55
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in exec ute' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:inexec
ute’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in invo ke' c:/Program Files/Ruby/lib/ruby/1.8/thread.rb:135:insynchronize’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in invo ke' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:inrun

c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run

c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7
c:/Program Files/Ruby/bin/rake.bat:25

I just found out that the new release of BgRB doesn’t work on Rails, my
friend has it working on mac. Now my question is will it work on
Bluehost ? Or is there an alternative that works under windows ?

grtz
DP