Performing arbitrary ruby scripts from rails

Sounds like you need BackgroundDRb http://backgroundrb.rubyforge.org/