usr/local/lib/ruby/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/connection_specification.rb:177:in `rescue in spec': Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError)
from /usr/local/lib/ruby/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/connection_specification.rb:174:in `spec'
from /usr/local/lib/ruby/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_handling.rb:50:in `establish_connection'
from piaohua.rb:7:in `<main>'
以上是报错的
require 'active_record'
require 'mysql2'
ActiveRecord::Base.establish_connection(
:adapter => "mysql2",
:host => "rds7hj9v8v******.mysql.rds.aliyuncs.com",
:database => "data******",
:username => "123******",
:password => "12******3",
:encoding => "utf8")
class DvdColumn < ActiveRecord::Base #dvd_column
end