Instead of the simple Ruby script, I think GoAccess is better. It's a simple command line tool available in nearly all package managers. You can simply pipe your logs to it and get an ncurses based summary of the site.
zcat /var/log/nginx/access.log* | goaccess