Wednesday 30 January 2008

rails 2.0 with sql-server


gem install activerecord-sqlserver-adapter --source=http://gems.rubyonrails.org


get the Ruby-dbi from this site rubyForge

After downloading it, use WinAce (or something else )to unpack the files and copy the following file lib/dbd/ADO.rb to /ruby/lib/ruby/site_ruby/1.8/DBD/ADO/ADO.rb

Now insert the following in the database.yml file (in \config dir of your rails app)

development:
adapter: sqlserver
database: "DATABASENAME"
host: .
username: "USERNAME"
password: "PASSWORD"

where databasename, username, and password (remove comeplete tag) should be inserted. and if the sql server is not running on the local host, then the "." should be exchanged to the proper path. fx. if my server was called "ruby" and my username was "user" and password was "user" then it should look like this:

development:
adapter: sqlserver
database: ruby
host: .
username: user
password: pass

No comments: