Closed toamitkumar closed 13 years ago
ruby 1.9.2 tiny_tds --> 0.4.3 sql server adapter --> 3.0.15
Not much to go on here. You more than likely do not have TinyTDS/Adapter configured correction via a database.yml. Please do two things. Review the README for TinyTDS here https://github.com/rails-sqlserver/tiny_tds and setup a simple client in IRB and test your host/port/username/password/etc. Make sure you can get a connection. From there refer to the TinyTDS wiki page for information and general details https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Using-TinyTds. You will need to isolate the problem and let me know.
I had tried 'irb' and I was getting:
ruby-1.9.2-p290 :003 > client = TinyTds::Client.new(:username => 'mahauser', :password => 'm@h@user123!', :host => '10.32.49.7') TinyTds::Error: Adaptive Server connection failed
though telnet'ing works -->
bnl11538app002 current]$ telnet 10.32.49.7 1433 Trying 10.32.49.7... Connected to 10.32.49.7. Escape character is '^]'.
At this point you need to debug FreeTDS/TinyTDS. Have you read the read me and wiki pages? For instance, are you using at least 0.82 of FreeTDS, checked your freetds.conf file for possible pitfalls mentioned on the wiki page. Perhaps even tried using 0.92 and compiling a local gem, mentioned on the read me too? Also, try using 0.4.5 of TinyTDS, moot if you compile locally and bind to 0.92 FreeTDS as our master branch is the upcoming 0.5.0.
This helped. I used 'sm' framework to setup the machine which creates the freetds.conf file at the location --> /usr/local/bdsm/pkg/freetds/0.82/etc/ instead of /usr/local/etc
Such silly thing :)
FreeTDS 0.92 was released last week and is the preferred. It removes any need for us to rely on a freetds.conf file. You do not even need to install FreeTDS via some system package manager since our git repo will allow you to build and statically link FreeTDS 0.92 into a native gem specific to your platform. See the read me if your interested.
Cheers.
bnl11538app002 current]$ rails console bt_sandbox Loading bt_sandbox environment (Rails 3.0.9) ruby-1.9.2-p290 :001 > ActiveRecord::Base.connection TinyTds::Error: closed connection
The stack trace: