brianmario/mysql2 — Issue #218: RubyGem version error: mysql2(0.2.6 not ~> 0.3.6) (RuntimeError)
Author: Javix
Created: 2011-10-26 13:32:33+00:00
State: open

I tried to check the connection to the existing MySQL 5.0 DB with the following installed on Windows XP ruby environment:
```
- Ruby: ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
- Rails 3.1.1
- mysql2 gem: mysql2 (0.2.6 x86-mingw32)
```
When trying to execute the below code:
```
require 'rubygems'
require 'active_record'

ActiveRecord::Base.establish_connection(
:adapter => 'mysql2',
:database => 'DBNAME,
:host => 'SOMEHOST',
:username => 'SOMEUSER',
:password => 'SOMEPWD'
)

class Shop < ActiveRecord::Base
set_table_name :shop
end

results = Shop.all
puts "found: #{resultss.size}"

```
I got the following error:
```
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:
71:in `rescue in establish_connection': Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (RubyGem vers
ion error: mysql2(0.2.6 not ~> 0.3.6) (RuntimeError)
)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_spec
ification.rb:68:in `establish_connection'
from db_connection.rb:4:in `

'
```
I put the needed 'libmySQL.dll' in Ruby192/bin folder; Any idea? Thks