Skip to content

Platform Installation Windows

KDGundermann edited this page Sep 13, 2010 · 19 revisions

Ruby 1.9.1 on Rails 2.3.5 on Windows XP
[currently under test / March 2010]

Before installing activerecord-sqlserver-adapter you have to install the ruby-odbc gem
But beware ! It needs a C – compiler for installation.
Either you have a ten year old Microsoft MSVC++ 6.0 Compiler
or better you may install the Ruby Development Kit first.

So step by step:

  1. Install devkit
  2. gem install ruby-odbc
  3. gem install activerecord-sqlserver-adapter
  4. Maybe install
    Microsoft SQL Server 2005 Native Client
    Microsoft SQL Server 2008 Native Client
  5. Create a ODBC Data Source
  6. Modify database.yml
    development:
    adapter: sqlserver
    database: MyDatabase
    dsn: dsn_MyDatabase
    mode: odbc
    username: TestUser
    password: xxxxx
    encoding: utf8
  7. Create an activemodel
    class Customer < ActiveRecord::Base
    set_table_name “dbo.Customer”
    set_primary_key “CustomerID”
    end
  8. Create an activecontroller
    class CustomerController < ApplicationController
def index @customers = Customer.find(:all, :conditions => [“CustName LIKE ‘Klaus%’”]) respond_to do |format| format.html end end end
  1. StartRails: ruby script\server

and voilá : I get the error message : “failed to allocate memory”
ok, stay tuned I will do my best to find the failure cause