Have you heard of a web framework called Ruby on Rails? There're a lot of stuff hidden under the hood of Ruby on Rails that you might not know about, and it might be really useful for you even if you aren't creating a web application. Let's not reimplement the wheel, and see what you can do if you include some part of Rails into your Ruby project.
Presented at RubyConf China 2013 on Oct 27, 2013.
Video is available at http://www.infoq.com/cn/presentations/hidden-gems-inside-those-of-Ruby-on-rails