HELP: undefined method cattr_accessor

hi to all,

when i try to generate a new model, i get the following error message.

D:\InstantRails\rails_apps\AR_ODBC>ruby script/generate model
amempldept
D:/Projekt/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/connection_adapters/abstract/connection_specification.r
b:14: undefined method cattr_accessor' for ActiveRecord::Base:Class (NoMethodError) from D:/Projekt/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 27:ingem_original_require’
from D:/Projekt/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
27:in `require’
from D:/Projekt/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/connection_adapters/abstract_adapter.rb:10

from D:/Projekt/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
27:in gem_original_require' from D:/Projekt/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 27:inrequire’
from D:/Projekt/ruby/lib/ruby/gems/1.8/gems/odbc-rails-1.4/lib/
active_record/connection_adapters/odbc_adapter.rb:27
from D:/Projekt/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
27:in gem_original_require' from D:/Projekt/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 27:inrequire’
… 6 levels…
from D:/Projekt/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/
generate.rb:1
from D:/Projekt/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
27:in gem_original_require' from D:/Projekt/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 27:inrequire’
from script/generate:3

RUBYOPT=-rubygems is set
connection via an spezial odbc driver (not one of the default drivers)

connection via the special driver is posible.

<<
require ‘odbc’
puts “Starte Verarbeitung ODBC”

DSN =‘ABC’
USR =‘Admin’
PWD =‘password’

con=ODBC.connect(DSN,USR,PWD)

puts con
print “\n”

sSQL = “SELECT lPortfolioItemId, User.Name, User.FirstName,
Model.Nature.Name FROM amPortfolio WHERE lPortfolioItemId > 10000
AND lPortfolioItemId<=32729”

rs = con.prepare(sSQL)
rs.execute

rs.columns {|col|
print(col.name, " — " )
}
print “\n”

rs.each{ |row|
row.each { |col|
print(col, " ")
}
print “\n”
}

print “\n”

puts “Verbindung geschlossen”

rs.close

con.disconnect

does someone has an idea…

thx

Achim

Hello everyone!

I am developing a rails application that inside a controller wants to
make a request to a web service. For testing purposes I developed the
web service inside that very same rails application.

When I call the controller this one seems to hang while trying to
connect to the web service. So my question here, and the only logical
explanation I have is:

Is Rails single threaded? (If so I will have to put the sample web
service on another instance of rails…)

Thanks a lot!

Enrique

Hi. Yes rails is single threaded so use diffent instances of mongrel to
run it.

2007/7/17, Enrique Comba R. [email protected]:

Is Rails single threaded? (If so I will have to put the sample web
service on another instance of rails…)

Thanks a lot!

Enrique

Andreas Kviby
Telefon 070-352 66 76
E-post [email protected]

On 17/07/2007, at 12:41, Andreas Kviby wrote:

Hi. Yes rails is single threaded so use diffent instances of
mongrel to run it.

Thanks Andreas, I thought so :slight_smile:

Cheers,

Enrique