# RubyOnRails with MS SQL - Connectivity Error

**URL:** <https://www.ruby-forum.com/t/rubyonrails-with-ms-sql-connectivity-error/158454>\
**Category:** Rails\
**Created:** [January 23, 2009, 2:49pm UTC](https://www.ruby-forum.com/t/rubyonrails-with-ms-sql-connectivity-error/158454 "2009-01-23T14:49:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tnyplz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@tnyplz](https://www.ruby-forum.com/u/tnyplz)\
**Post date:** [January 23, 2009, 2:49pm UTC](https://www.ruby-forum.com/t/rubyonrails-with-ms-sql-connectivity-error/158454/1 "2009-01-23T14:49:01Z")

</div>

Hi all…  
Please help me solve the issue.  
While trying to create a connection with MS SQL database in RubyOnRails,  
I’m getting a â€˜Deprecated …â€™ error. (I referenced a doc posted in net  
for the same.)  
System details: OS: Windows Xp  
Ruby version: 1.8.6  
Rails: 2.1.2  
Gems: 1.3.1  
RadRails: 0.7.2  
Ruby-dbi: 0.2.0  
Also installed the ADO.rb file and placed in  
D:\Ruby\lib\ruby\site\_ruby\1.8\DBD\ADO

PFB the details of the error. Please put some light on this.  
\*\* Invoke db:create (first\_time)  
\*\* Invoke environment (first\_time)  
\*\* Execute environment  
\*\* Execute db:create  
rake aborted!  
no such file to load – deprecated  
D:/Ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:31:in  
`gem_original_require' D:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in`require’  
D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active\_support/dependencies.rb:510:in  
`require' D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:355:in`new\_constants\_in’  
D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active\_support/dependencies.rb:510:in  
`require' D:/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:48 D:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in`gem\_original\_require’  
D:/Ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:31:in  
`require' D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in`require’  
D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active\_support/dependencies.rb:355:in  
`new_constants_in' D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in`require’  
D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active\_support/core\_ext/kernel/requires.rb:7:in  
`require_library_or_gem' D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/core_ext/kernel/reporting.rb:11:in`silence\_warnings’  
D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active\_support/core\_ext/kernel/requires.rb:5:in  
`require_library_or_gem' D:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/sqlserver_adapter.rb:28:in`sqlserver\_connection’  
D:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active\_record/connection\_adapters/abstract/connection\_specification.rb:292:in  
`send' D:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:in`connection=’  
D:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active\_record/connection\_adapters/abstract/connection\_specification.rb:260:in  
`retrieve_connection' D:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in`connection’  
D:/Ruby/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/tasks/databases.rake:32:in  
`create_database' D:/Ruby/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/tasks/databases.rake:26 D:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:621:in`call’  
D:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:621:in `execute' D:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:616:in`each’  
D:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:616:in `execute' D:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:582:in`invoke\_with\_call\_chain’  
D:/Ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize' D:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:575:in`invoke\_with\_call\_chain’  
D:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:568:in `invoke' D:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2031:in`invoke\_task’  
D:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2009:in  
`top_level' D:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2009:in`each’  
D:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2009:in  
`top_level' D:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2048:in`standard\_exception\_handling’  
D:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2003:in  
`top_level' D:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:1982:in`run’  
D:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2048:in  
`standard_exception_handling' D:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:1979:in`run’  
D:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/bin/rake:31  
D:\Ruby\bin\rake:19:in `load' D:\Ruby\bin\rake:19 -e:3:in`load’  
-e:3

A prompt reply would be appreciated.

---

<div class="post-metadata">

**Author:** ![tnyplz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@tnyplz](https://www.ruby-forum.com/u/tnyplz)\
**Post date:** [January 24, 2009, 11:59am UTC](https://www.ruby-forum.com/t/rubyonrails-with-ms-sql-connectivity-error/158454/2 "2009-01-24T11:59:33Z")

</div>

Weird;

Whats in your database.yml?

I take it you’ve installed the sqlserver-adapter?

From a command prompt if you run ruby script\server does it die  
immediately or is it only when you try to find on a model?

Cheers  
Luke

---

<div class="post-metadata">

**Author:** ![tnyplz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@tnyplz](https://www.ruby-forum.com/u/tnyplz)\
**Post date:** [January 24, 2009, 1:26pm UTC](https://www.ruby-forum.com/t/rubyonrails-with-ms-sql-connectivity-error/158454/3 "2009-01-24T13:26:31Z")

</div>

I had a similiar issue but I am developing on Mac OSX, Rails 2.1.2,  
ruby-dbi 0.40, and a self fork version of sqlserver adapter. I know  
ruby-dbi 0.40 requires the gem deprecated \>= 2.0. Maybe that’s what  
you are missing too.

On Jan 23, 8:49 am, Tony P. \<rails-mailing-l…@andreas-

---

<div class="post-metadata">

**Author:** ![tnyplz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@tnyplz](https://www.ruby-forum.com/u/tnyplz)\
**Post date:** [January 27, 2009, 9:16am UTC](https://www.ruby-forum.com/t/rubyonrails-with-ms-sql-connectivity-error/158454/4 "2009-01-27T09:16:13Z")

</div>

Hi Luke,

PFB the details in database.yml

development:  
adapter: sqlserver  
database: Test123  
username: sa  
password: test@123  
host: kec4121228d

Yes, I have downloaded the sql\_adapter and placed it in  
\<ruby\_home\>\lib\ruby\gems\1.8\gems\activerecord-2.1.2\lib\active\_record\connection\_adapters

PFA the sqlserver-adapter. Please verify and let me know if I have  
installed the correct one. All I did was placed the adapter in this  
location and tried to re-connect to the remote SQL server from RadRails.

Awaiting your response to proceed further.

Regards,  
Tony

Luke P. wrote:

> Weird;
> 
> Whats in your database.yml?
> 
> I take it you’ve installed the sqlserver-adapter?
> 
> From a command prompt if you run ruby script\server does it die  
> immediately or is it only when you try to find on a model?
> 
> Cheers  
> Luke

---

<div class="post-metadata">

**Author:** ![tnyplz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@tnyplz](https://www.ruby-forum.com/u/tnyplz)\
**Post date:** [January 27, 2009, 1:31pm UTC](https://www.ruby-forum.com/t/rubyonrails-with-ms-sql-connectivity-error/158454/5 "2009-01-27T13:31:30Z")

</div>

Luke P. wrote:

> iawgens had the answer - you need to install the deprecated gem
> 
> From a command prompt:  
> gem install deprecated
> 
> See here another person with the same issue  
> [sql server - Setting up Rails to work with sqlserver - Stack Overflow](http://stackoverflow.com/questions/130547/setting-up-rails-to-work-with-sqlserver)

Thanks a lot Luke… Let me try the same

---

<div class="post-metadata">

**Author:** ![tnyplz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@tnyplz](https://www.ruby-forum.com/u/tnyplz)\
**Post date:** [January 27, 2009, 10:34am UTC](https://www.ruby-forum.com/t/rubyonrails-with-ms-sql-connectivity-error/158454/6 "2009-01-27T10:34:10Z")

</div>

iawgens had the answer - you need to install the deprecated gem

From a command prompt:  
gem install deprecated

See here another person with the same issue

> <https://stackoverflow.com/questions/130547/setting-up-rails-to-work-with-sqlserver>

---

<div class="post-metadata">

**Author:** ![tnyplz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@tnyplz](https://www.ruby-forum.com/u/tnyplz)\
**Post date:** [January 28, 2009, 5:37am UTC](https://www.ruby-forum.com/t/rubyonrails-with-ms-sql-connectivity-error/158454/7 "2009-01-28T05:37:43Z")

</div>

Hi Luke,

I installed deprecated-2.0.1.gem I have also installed the gem dbi-0.4.0  
and placed the ADO.rb file in the location :  
\<Ruby\_Home\>\lib\ruby\site\_ruby\1.8\DBD\ADO  
and now I’m getting a different error as shown below:

- Invoke db:migrate (first\_time)  
\*\* Invoke environment (first\_time)  
\*\* Execute environment  
\*\* Execute db:migrate  
rake aborted!  
Unable to load driver ‘ADO’  
D:/Ruby/lib/ruby/site\_ruby/1.8/dbi.rb:286:in `load_driver' D:/Ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize’  
D:/Ruby/lib/ruby/site\_ruby/1.8/dbi.rb:236:in `load_driver' D:/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:154:in `\_get\_full\_driver’  
D:/Ruby/lib/ruby/site\_ruby/1.8/dbi.rb:139:in `connect' D:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/sqlserver_adapter.rb:46:in `sqlserver\_connection’  
D:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active\_record/connection\_adapters/abstract/connection\_specification.rb:292:in  
`send' D:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:in `connection=’  
D:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active\_record/connection\_adapters/abstract/connection\_specification.rb:260:in  
`retrieve\_connection’

Awaiting your response again 🙂

Tony P. wrote:

> Luke P. wrote:
> 
> > iawgens had the answer - you need to install the deprecated gem
> > 
> > From a command prompt:  
> > gem install deprecated
> > 
> > See here another person with the same issue  
> > [sql server - Setting up Rails to work with sqlserver - Stack Overflow](http://stackoverflow.com/questions/130547/setting-up-rails-to-work-with-sqlserver)
> 
> Thanks a lot Luke… Let me try the same

---

<div class="post-metadata">

**Author:** ![tnyplz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@tnyplz](https://www.ruby-forum.com/u/tnyplz)\
**Post date:** [January 28, 2009, 9:18am UTC](https://www.ruby-forum.com/t/rubyonrails-with-ms-sql-connectivity-error/158454/8 "2009-01-28T09:18:44Z")

</div>

> I have also installed the gem dbi-0.4.0

Tony,

I would stick with the older version of ADO one of the 2.x series I’m  
not sure it’ll work with the new dbi.

Cheers  
Luke
