These are chat archives for rails-sqlserver/activerecord-sqlserver-adapter

24th
Nov 2016
KhaledAB
@KhaledAB
Nov 24 2016 08:59
Hi Dears
i need to connect rails with sqlserver 2012
how to do this ?
i spend more than 3 days searching
and i follow this steps

SQL Server (2005 or higher recommended)
#

Install the adapters and driver

gem install tiny_tds

gem install activerecord-sqlserver-adapter

#

Ensure the activerecord adapter and db driver gems are defined in your Gemfile

gem 'tiny_tds'

gem 'activerecord-sqlserver-adapter'

#

You should make sure freetds is configured correctly first.

freetds.conf contains host/port/protocol_versions settings.

http://freetds.schemamania.org/userguide/freetdsconf.htm

#

A typical Microsoft server

[mssql]

host = mssqlserver.yourdomain.com

port = 1433

tds version = 7.1

If you can connect with "tsql -S servername", your basic FreeTDS installation is working.

'man tsql' for more info

Set timeout to a larger number if valid queries against a live db fail

#

now i get error
Gem Load Error is: undefined method add_order!' for class#<Class:ActiveRecord::Base>'
what i have to do
kindly i need some help
KhaledAB
@KhaledAB
Nov 24 2016 10:22
Hi dears is anyone here
Ken Collins
@metaskills
Nov 24 2016 12:40
Morning.
I think you are using Rails 5... you need to use Rails 4
gem install rails -v 4.2.7.1
rails _4.2.7.1_ new MYAPP --database=sqlserver
KhaledAB
@KhaledAB
Nov 24 2016 13:03
Yes i am using rails 4
Sorry rails 5
So i have to use rails 4 ??
Ken Collins
@metaskills
Nov 24 2016 13:18
Yes... I am still working on Rails v5
Just got back into it last night.
Will be a few weeks till ready.
See top of README