Forum: Ruby on Rails RubyOnRails with MS SQL - Connectivity Error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
442f1c05ac02e1934cde594a185807a9?d=identicon&s=25 Tony Puthenveettil (tonyputhenveettil)
on 2009-01-23 14:49
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.
85f8b7bbe07bff22e0b38cca818cf692?d=identicon&s=25 Luke Pearce (kule)
on 2009-01-24 11:59
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
F12caa5196374c2c4ba299dca72288d9?d=identicon&s=25 iawgens (Guest)
on 2009-01-24 13:26
(Received via mailing list)
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 Puthenveettil <rails-mailing-l...@andreas-
442f1c05ac02e1934cde594a185807a9?d=identicon&s=25 Tony Puthenveettil (tonyputhenveettil)
on 2009-01-27 09:16
Attachment: sqlserver_adapter.rb (20 KB)
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 Pearce 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
85f8b7bbe07bff22e0b38cca818cf692?d=identicon&s=25 Luke Pearce (kule)
on 2009-01-27 10:34
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
http://stackoverflow.com/questions/130547/setting-...
442f1c05ac02e1934cde594a185807a9?d=identicon&s=25 Tony Puthenveettil (tonyputhenveettil)
on 2009-01-27 13:31
Luke Pearce 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
> http://stackoverflow.com/questions/130547/setting-...

Thanks a lot Luke... Let me try the same
442f1c05ac02e1934cde594a185807a9?d=identicon&s=25 Tony Puthenveettil (tonyputhenveettil)
on 2009-01-28 05:37
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 Puthenveettil wrote:
> Luke Pearce 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
>> http://stackoverflow.com/questions/130547/setting-...
>
> Thanks a lot Luke... Let me try the same
85f8b7bbe07bff22e0b38cca818cf692?d=identicon&s=25 Luke Pearce (kule)
on 2009-01-28 09:18
> 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
This topic is locked and can not be replied to.