Creating CSV files in Ruby is painful! CSV Shaper makes life easier! It's ideal for converting database backed models with attrbiutes into CSV output. It can be used without Rails, but works great with ActiveRecord models and even comes with support for it's own template handling.
Gemfile gem 'csv_shaper', '~> 0.3.0'
install gem install csv_shaper -v 0.3.0