07 Jan 2013, 12:13
20120621_115648_pragsmall

Rahul Panjiyar (6 posts)

require 'active_record'
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3',
:database => 'db/bank.db')
ActiveRecord::Migrator.migrate("db/migrate/")
class Account < ActiveRecord::Base
validates_uniqueness_of :number

it is for sqlite but i wanna add mysql as server on that but only changing adapter as mysql2 doesn’t support my code although i have added mysql in gemfile. Also, i have added database.yml file where i had properly set the host as 127.0.0.1. but i got error as while running cucumber: Can’t connect to MySQL server on ‘localhost’ (10061) (Mysql2::Error)

07 Jan 2013, 13:26
Avatar_pragsmall

Matt Wynne (87 posts)

Sorry Rahul, you’re on your own if you want to do things that aren’t in the book! :)

I would try asking for support from the ActiveRecord community.

  You must be logged in to comment