-
-
Save toamitkumar/914923 to your computer and use it in GitHub Desktop.
1) Download and install FreeTDS | |
2) Configure FreeTDS (make an entry inside /usr/local/etc/freetds.conf) | |
[free_tds_server] | |
host = <sql server> | |
port = 1433 | |
tds version = 8.0 | |
encryption = no | |
3) Install ruby gems | |
i) gem install activerecord-sqlserver-adapter | |
ii) gem install tiny_tds | |
4) database.yml | |
development: | |
adapter: sqlserver | |
mode: dblib | |
dataserver: my_sql_server | |
database: my_database_name | |
username: my_username | |
password: xxxxx | |
timeout: 5000 |
So do you mean - the free tds library won't be required or do you mean, free_tds.conf is not required (and can be made in database.yml) ?
I really like the simplicity, would be glad to make it simpler further !
FreeTDS is still a dependency to which TinyTDS compiles against. However, the freetds.conf is no longer needed with the new host/port options. You can just use them instead of a dataserver.
I am getting:
ArgumentError: Missing :dataserver configuration.
from /Users/toamitkumar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-sqlserver-adapter-3.0.12/lib/active_record/connection_adapters/sqlserver_adapter.rb:25:in `sqlserver_connection'
from /Users/toamitkumar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `send'
from /Users/toamitkumar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `new_connection'
from /Users/toamitkumar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:237:in `checkout_new_connection'
from /Users/toamitkumar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:191:in `checkout'
from /Users/toamitkumar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:187:in `loop'
from /Users/toamitkumar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:187:in `checkout'
from /Users/toamitkumar/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/monitor.rb:242:in `synchronize'
development:
adapter: sqlserver
mode: dblib
host:
port: 1433
database: hsidb
username: hsiuser
password: hsiuser123
timeout: 5000
Are you using the latest v0.4.4 of TinyTDS? Also what version of FreeTDS are you using?
TinyTDS version 0.4.4
and FreeTDS version 0.82
I am testing now, but this might be something that only works in the soon to be released 0.91 of FreeTDS :(
aaahh ok
going to pull 0.91 from nightly builds and testing it
This is the one in the project ports file.
http://www.ibiblio.org/pub/Linux/ALPHA/freetds/current/freetds-current.tgz
FYI, you should be able to clone the repo and do:
$ rake compile
$ rake native gem
And that will make a gem for your system. You can then move it around and do "gem install 'thatgemfile'"
It get's better. As of 0.4.4 of TinyTDS, you can now just ignore FreeTDS and specify & in database.yml, make sure to remove too.