Re: [Rails] Using active record outside rails

2016-09-28 Thread Karthikeyan A K
Thanks for the reply, I should have used mysql2 as adapter ;) Banging my head for not discovering it early :D On Wed, Sep 28, 2016 at 5:40 PM, James Jelinek wrote: > ActiveRecord is an actual gem that must be installed ergo why it's asking > for it to be in the Gemfile. Yes it's tightly coupled

Re: [Rails] Using active record outside rails

2016-09-28 Thread James Jelinek
ActiveRecord is an actual gem that must be installed ergo why it's asking for it to be in the Gemfile. Yes it's tightly coupled with rails but you can absolutely use it in a plain Ruby app. Just install the gems you need and in pry/irb you can call require and it'll load the library provided tha

[Rails] Using active record outside rails

2016-09-28 Thread Karthikeyan A K
Hello People, I tried this in pry [2] pry(main)> require 'mysql2' => true [3] pry(main)> require 'active_record' => true [4] pry(main)> ActiveRecord::Base.establish_connection(:adapter => 'mysql', :database => 'db_name', :username => 'root', :password => 'root', :host => 'localhost') And got t