Like mistwang said, we definitely recommend using our easy raills setup outlined in our wiki. It will make your life a lot easier.
From the looks of it, your Soft/hard memory limits are set way to low if you expect your scripts to return large buffered db data sets. If you are returning 30K rows containing blobs, I'm just throwing out a relative figure, you can easily exhaust this value. Remember, this is not a "Per Ruby/Rails Process" limit but the limit for all the ruby rail processed spawned total.