Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Missing the mysql2 gem. Add it to your Gemfile: gem 'mysql2'

Thread Tools

Missing the mysql2 gem. Add it to your Gemfile: gem 'mysql2'

Jakub Flaška
Posts: n/a
Hello I have this small script:

require 'active_record'

:adapter => 'mysql',
:database => 'cards',
:username => 'user',
assword => 'myPassword',
:host => 'localhost',
:charset => 'utf8',
:encoding => 'utf8',
ort => '3306')

class Start < ActiveRecord::Base
set_table_name "grb_tGStart"
set_primary_key "start_id"
has_many osts

starts = Start.find(:all, :conditions => [ "agency_id = (?) AND
is_active = (?)", 17, 1 ])


And I got this error:
`rescue in mysql_connection': !!!
Missing the mysql2 gem. Add it to your Gemfile: gem 'mysql2'

Every hint to this issue points on a file: database.yml and there to
change adapter: mysql, to adapter: mysql2.
But I don't know what's the file databases.yml I don't have it in my
project. Can you please advice me, what's the file databases.yml?

Posted via

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mysql2::Error: Can't create database Rajesh B. Ruby 2 03-25-2011 08:39 PM
Rails: Problem with test-environment and mysql2 database vivec manavortex Ruby 3 01-26-2011 01:14 PM
gem 1.3.0, netbeans 6.1 "Missing the Rails gem" Pablo Q. Ruby 4 10-09-2008 04:12 AM
RubyGems 0.9.1 calling a gem with gem '<gem>' Austin 7873 Ruby 5 01-27-2007 10:05 PM
[ANN] Getopt-Declare 1.12 (gem/zip) and GGEnv (gem/zip) gga Ruby 0 07-18-2005 03:21 PM