2010-10-17 60 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