2010-10-17 45 views
1

的Ruby版本生成模型:3.0.2 的Rails:1.9.2 操作系统:Windows 7 DB:SQL Server 2008中(R2)如何获得Ruby on Rails的使用SQL Server 2008

我试着执行以下命令:轨生成模型产品

的错误我得到的可以看这里:

我试图按照这两个网站pastebin.ca/1965168: ruby​​railsandwindows.blogspot.com/2008/03/ rails-2-and-sql-server-2008-on-windows_24.html

www.lostechies.com/blogs/rhouston/archive/2008/05/03/connecting-activerecord-to-sql-server.aspx

我跑了以下内容:安装了activerecord-SQLSERVER适配器 这似乎安装了宝石,我确认在我的红宝石安装中有一个activerecord目录。

我也跑:创业板安装DBI-0.4.3

我database.yml文件包含以下内容: 适配器:SQLSERVER 模式:ODBC DSN:sqlTest_development 主机:本地主机 用户名:sqltest语句 密码: pool:20 timeout:50000

如果您需要任何其他信息,请让我知道。我试过其他网站,但人们只是告诉我,我应该切换到Linux,这不是很有帮助。

回答

1

为什么不只是使用活动记录?对不起不熟悉SQL Server连接..

:adapter => "sqlserver", 
:host => ".\\SQLEXPRESS", 
:database => "MyDB", 
:username => "sa", 
:password => "sa" 

这里与ODBC示例:http://github.com/aslakhellesoy/activerecord-sqlserver-adapter/blob/master/test/connections/native_sqlserver_odbc/connection.rb

但我认为这个链接到实际创业板将帮助最: http://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Platform-Installation---Windows

0

我对不起,从2008年的指南是老... (sqlserver适配器不再需要dbi) 正如尼克说:去Git上的activerecord适配器的wiki