I working on Ruby on Rails application using a PostgreSQL database. I have heard of the Data Export API for GA. However, after reading through there documentation I am still a little confused about how to export the data.
To summarize, my goal is to export the summary data from GA, turn it into a csv file, and then insert it into my database. Any direction in terms of how to do this would be greatly appreciated.
Also check out the Google Analytics App Gallery. Here you will find many 3rd party tools that may do most of the programming for you.
Start with the Data Export API Client Libraries & Sample Code
There are some Ruby examples in there.