ActiveRecord is fairly simple to extract from the rails stack. In this example we can see how to create a DB table of users without all the overhead of Rails or Sinatra. require ‘rubygems’ require ‘fastercsv’ require ‘active_record’   # Set up AR connection and define User class   ActiveRecord::Base.establish_connection( :adapter => "postgres", :host => "localhost", :username => "brettu", :password => "********", :database => "clients" )   # This assumes we have a table set up already. class User set_table_name ‘user’ set_primary_key ‘userid’ end   FasterCSV.foreach(’email_list.csv’, headers: true) do |row| User.create! row.to_hash end :)