Ruby ActiveRecord (without Rails) Tutorial
The Ruby ActiveRecord gem provides easy-to-use abstractions for working with databases and allows you to easily swap out the database backend. For example to switch from SQLite3 to MySQL without changing code. It has built-in support for database abstractions to SQLite3, MySQL, and PostgreSQL. One of the primary aspects of ActiveRecord is that there is very little to no configuration needed. It follow convention over configuration.
ActiveRecord is commonly used with the Ruby-on-Rails framework but you can use it with Sinatra or without any web framework if desired.This tutorial will focus on using it independently, outside of any other framework.
See my SQLite3 Tutorial and Ruby SQLite3 Tutorial for more background on using SQLite3 directly. It is good to have a solid foundation with SQL before trying to work with ActiveRecord.