ActiveRecord / SQL Server / ADO

J

Jayson Bailey

I'm trying to use ActiveRecord with SQL Server and ADO in a regular ruby
script, but can't get it working. I've seen a bunch of examples but
can't get them to work.

Here's what I've 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've 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
 
J

jamecook

I'm trying to use ActiveRecord with SQL Server and ADO in a regular ruby
script, but can't get it working. I've seen a bunch of examples but
can't get them to work.

Here's what I've 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've 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

I believe you need to use 'gem' or 'require_gem' for active_record.
 
J

jamecook

I'm trying to use ActiveRecord with SQL Server and ADO in a regular ruby
script, but can't get it working. I've seen a bunch of examples but
can't get them to work.

Here's what I've 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've 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

I believe you need to use 'gem' or 'require_gem' for active_record.
 
S

Stefan Mahlitz

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
 
S

Stefan Mahlitz

Jayson said:
I'm trying to use ActiveRecord with SQL Server and ADO in a regular ruby
script, but can't get it working. I've seen a bunch of examples but
can't get them to work.

Here's what I've 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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top