Ironruby activerecord sqlserver

Hi all

When running this ruby program:

require ‘rubygems’
require ‘active_record’
require ‘yaml’
ActiveRecord::Base.establish_connection(
:adapter => ‘sqlserver’,
:database => ‘xxxxx’,
:username => ‘sa’,
:password => ‘pass’,
:mode => ‘ODBC’,
:host => “MYLAPTOP\SQLSERVER”)

class User < ActiveRecord::Base
end
puts User.count


These are the local gems installed:

actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activerecord-sqlserver-adapter (2.3.8)
activeresource (2.3.8)
activesupport (2.3.8)
dbd-adonet (0.3.2)
dbd-adonet-sqlserver (0.3.2)
dbi (0.4.3)
deprecated (3.0.0)
rack (1.1.0)
rails (2.3.8)
rake (0.8.7)

I’m receiving the following error:

WARNING: YAML.add_builtin_type is not implemented

C:/Program Files/IronRuby
1.0v4/lib/ironruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in
require': no such file to load -- odbc (MissingSourceFile) from C:/Program Files/IronRuby 1.0v4/lib/ironruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependenc ies.rb:490:innew_constants_in’
from C:/Program Files/IronRuby
1.0v4/lib/ironruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependenc
ies.rb:154:in `require’


What am I missing?

the config is wrong

http://github.com/casualjim/irontwitter/blob/master/config/database.yml
http://github.com/casualjim/irontwitter/blob/master/config/database.yml
http://github.com/casualjim/irontwitter/blob/master/config/environment.rb

http://github.com/casualjim/irontwitter/blob/master/config/environment.rbBut
I believe the official sqlserver-adapter that comes with rails has
ironruby
support now.
Anyway ODBC is most likely the wrong choice. Unless you’re using MRI on
a
non-windows system you want to use ADONET for .NET and ADO for MRI.

The config for the rails sqlserver gem is the same as the one I’m
showing.
but the gems most likely aren’t

Met vriendelijke groeten - Best regards - Salutations
Ivan Porto C.
Twitter: http://twitter.com/casualjim
Author of IronRuby in Action (http://manning.com/carrero)
Microsoft IronRuby/C# MVP

Thank you, Thank you, Thank you
It works now!!!

Eduardo

PS: by the way when is the ETA of your book IronRuby in action?
Ivan Porto C. wrote:

the config is wrong

http://github.com/casualjim/irontwitter/blob/master/config/database.yml
http://github.com/casualjim/irontwitter/blob/master/config/database.yml
http://github.com/casualjim/irontwitter/blob/master/config/environment.rb

http://github.com/casualjim/irontwitter/blob/master/config/environment.rbBut
I believe the official sqlserver-adapter that comes with rails has
ironruby
support now.
Anyway ODBC is most likely the wrong choice. Unless you’re using MRI on
a
non-windows system you want to use ADONET for .NET and ADO for MRI.

The config for the rails sqlserver gem is the same as the one I’m
showing.
but the gems most likely aren’t

Met vriendelijke groeten - Best regards - Salutations
Ivan Porto C.
Twitter: http://twitter.com/casualjim
Author of IronRuby in Action (http://manning.com/carrero)
Microsoft IronRuby/C# MVP