メモ代わり。 ActiveRecord require 'rubygems' require 'active_record' ActiveRecord::Base.establish_connection( :adapter => 'postgresql', :host => 'localhost', :username => 'foo', :database => 'baz', :encoding => 'utf8' ) class User < ActiveRecord::Base end User.find(:all).each do |u| p u end Migrate Rakefile ほんとは設定ファイルわけたほうがいいんだけどね require 'rubygems' require 'active_record' require 'logger' ActiveRecord: