I'm trying to access a mysql database using ruby with ActiveRecord. The ruby file is dbtest.rb.
require 'rubygems' require 'active_record' ActiveRecord::Base.establish_connection( :adapter => "mysql2", :host => "localhost", :database => "students" ) class Rubyist < ActiveRecord::Base end When I try to load this file via irb or run it using ruby I get the following error:
.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require': Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` I've installed both the mysql2 gem and activerecord-mysql2-adapter successfully. When I installed the activerecord-mysql2-adapter I received the following messages:
gem install activerecord-mysql2-adapter Fetching: activerecord-mysql2-adapter-0.0.3.gem (100%) Successfully installed activerecord-mysql2-adapter-0.0.3 1 gem installed Do I need to rename the adapter?