we\'ve just upgraded to Rails 3.2.5 from Rails 3.0.7 and using the assets-pipeline compilation on the fly for the staging server, but some times we face this exception !
It's simple to spend the three minutes (maybe two if you type fast) to add a swap file to your server.
If you're running Ubuntu (not sure how well this works for other Linux flavors), just follow this tutorial from DigitalOcean:
https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04
Voila!