ActiveRecord / SQL Server / ADO
5 Message(s) by 3 Author(s) originally posted in ruby programming
| From: Jayson Bailey |
Date: Friday, October 26, 2007
|
I'm trying to use ActiveRecord with
SQL Server and
ADO in a regular ruby
script, but can not get it working. I have seen a bunch of examples but
can not get them to work.
Here's what I have got:
require 'rubygems'
require 'active_record'
class TestMO
< ActiveRecord::Base
ActiveRecord::Base.establish_connection(
:adapter => "sqlserver",
:mode => "ado",
:database => "mydb",
:username => "user",
:password => "pass"
)
set_table_name "test_mo"
end
I have got the ADO.rb in the right place I believe.
Here's the
error I'm getting:
custom_require.rb:27:in `gem_original_require': no such
file to
load
--
Posted via
http://www.ruby-forum.com/.
| From: jamecook |
Date: Friday, October 26, 2007
|
wrote in message:
I'm trying to use ActiveRecord with SQL Server and ADO in a regular ruby
script, but can not get it working. I have seen a bunch of examples but
can not get them to work.
Here's what I have got:
require 'rubygems'
require 'active_record'
class TestMO < ActiveRecord::Base
ActiveRecord::Base.establish_connection(
:adapter => "sqlserver",
:mode => "ado",
:database => "mydb",
:username => "user",
:password => "pass"
)
set_table_name "test_mo"
end
I have got the ADO.rb in the right place I believe.
Here's the error I'm getting:
custom_require.rb:27:in `gem_original_require': no such file to load
--
Posted viahttp://www.ruby-forum.com/.
I believe you need to use 'gem' or 'require_gem' for active_record.
| From: jamecook |
Date: Saturday, October 27, 2007
|
wrote in message:
I'm trying to use ActiveRecord with SQL Server and ADO in a regular ruby
script, but can not get it working. I have seen a bunch of examples but
can not get them to work.
Here's what I have got:
require 'rubygems'
require 'active_record'
class TestMO < ActiveRecord::Base
ActiveRecord::Base.establish_connection(
:adapter => "sqlserver",
:mode => "ado",
:database => "mydb",
:username => "user",
:password => "pass"
)
set_table_name "test_mo"
end
I have got the ADO.rb in the right place I believe.
Here's the error I'm getting:
custom_require.rb:27:in `gem_original_require': no such file to load
--
Posted viahttp://www.ruby-forum.com/.
I believe you need to use 'gem' or 'require_gem' for active_record.
| From: Stefan Mahlitz |
Date: Saturday, October 27, 2007
|
wrote in message:
I believe you need to use 'gem' or 'require_gem' for active_record.
No, gem only sets the
version of a later required gem and require_gem is
deprecated.
irb(main):001:0> require "rubygems"
=> true
irb(main):002:0> require "active_record"
=> true
| From: Stefan Mahlitz |
Date: Saturday, October 27, 2007
|
wrote in message:
I'm trying to use ActiveRecord with SQL Server and ADO in a regular ruby
script, but can not get it working. I have seen a bunch of examples but
can not get them to work.
Here's what I have got:
require 'rubygems'
require 'active_record'
Here's the error I'm getting:
custom_require.rb:27:in `gem_original_require': no such file to load
Is this the exact line?
I got
irb(main):003:0> require "some"
MissingSourceFile: no such file to load -- some
from
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
Which version of rubygems are you using?
Next Message: Rounding to the nearest 0.05