# HELP: undefined method cattr\_accessor

**URL:** <https://www.ruby-forum.com/t/help-undefined-method-cattr-accessor/109618>\
**Category:** Rails\
**Created:** [July 17, 2007, 11:42am UTC](https://www.ruby-forum.com/t/help-undefined-method-cattr-accessor/109618 "2007-07-17T11:42:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 17, 2007, 11:42am UTC](https://www.ruby-forum.com/t/help-undefined-method-cattr-accessor/109618/1 "2007-07-17T11:42:43Z")

</div>

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:in`gem\_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:in`require’  
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:in`require’  
… 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:in`require’  
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

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 17, 2007, 12:24pm UTC](https://www.ruby-forum.com/t/help-undefined-method-cattr-accessor/109618/2 "2007-07-17T12:24:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 17, 2007, 12:42pm UTC](https://www.ruby-forum.com/t/help-undefined-method-cattr-accessor/109618/3 "2007-07-17T12:42:52Z")

</div>

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

2007/7/17, Enrique Comba R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> 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 removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 17, 2007, 1:07pm UTC](https://www.ruby-forum.com/t/help-undefined-method-cattr-accessor/109618/4 "2007-07-17T13:07:54Z")

</div>

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 🙂

Cheers,

Enrique
