[Ironruby-core] ironruby activerecord sqlserver

Ivan Porto Carrero ivan at cloudslide.net
Fri Jun 18 09:07:41 EDT 2010


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.rb>But
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 Carrero
Twitter: http://twitter.com/casualjim
Author of IronRuby in Action (http://manning.com/carrero)
Microsoft IronRuby/C# MVP


On Fri, Jun 18, 2010 at 2:40 PM, Eduardo Blumenfeld <lists at ruby-forum.com>wrote:

> 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:in `new_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?
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100618/4177a81a/attachment-0001.html>


More information about the Ironruby-core mailing list