• Answers
  • Web
Personalize Yedda, (And make Danny Happy)
People ask & answer about almost everything. Tell us what you're interested in... So we can personalize Yedda especially for you
I'm interested in:

Need help with 'cattr_accessor' ActiveRecord Error

Why am I getting this error from ActiveRecord? I have Ruby on Rails installed on my Mac Powerbook. I used the Hivelogic artilce as my installation guide and completed the installation without any errors. I have tried to install the latesst ActiveRecord gem, but when I run the locate cammand, it still references the old version of ActiveRecord.

/usr/local/lib/ruby/site_ruby/1.8/active_record/base.rb:246: undefined method `cattr_accessor' for ActiveRecord::Base:Class (NoMethodError)   from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from /usr/local/lib/ruby/site_ruby/1.8/active_record.rb:37
        from ./db.rb:1
        from script.rb:3

Any suggestions would be greatly appreciated.


Share Send to a friend Watch Report
 

Best Answer

 
4 helpful answers

Well, I don't know about the Hivelogic article. But once you have ruby and rubygems setup it should be all easyride.

try "gem list --local" to see what gems are installed.

Try uninstalling EVERYTHING. Then manually check that you have no traces of rails, or Active*ANYTHING installed.

Then do "gem install -y rails" which should bring you Rails + all the dependencies.

Your problem seems to be that your ActiveRecord is not installed as GEM but as a regular Ruby library.

it sits in /usr/local/lib/ruby/site_ruby/1.8/active_record/base.rb while it shoud be somewhere like /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb

 

this can happen if you manually compile it and do 'make install' equivalent. i.e. ruby install.rb or whatever. Don't do that! :-) Use gem. 

Posted 2006-09-17T08:19:41Z
pacman was invited by Yedda to answer this question.

Helpful?(4)
Rated as Best Answer

 

All Answers
Order by

 
1 helpful answer

Thanks for the reply.  

As you have probably already figured out. I'm new to the RoR game.   What's the command for uninstalling gems.

 Thanks Again,

 Jim

Posted 2006-09-17T11:01:00Z
 
4 helpful answers

to see a list of installed gems: gem list --local

to remove a gem: gem uninstall GEMNAME (i.e. gem uninstall rails, gem uninstall activerecord etc)

how original :-) 

Posted 2006-09-17T12:29:47Z
pacman was invited by Yedda to answer this question.

 
1 helpful answer

Making progress.

 I've used the gem uninstall command to remove all my gems - I'm gemless.

Now how should I manually check for rails or active anything. If I run a locate command on rails or activerecord it appears they are both lurking on my computer.

Then once I get all of references off my computer, I should run  "gem install -y rails"

Again, I really appreciate you help. I've been banging my head on the wall on this for about a week.

 

 

Posted 2006-09-17T13:17:07Z

Sign in to participate

Got an answer for yadda? Would you like to comment on the posted answers, or vote for the one which you think is the best?

Sign up for a free account, or sign in (if you're already a member).

Explore Related Questions

Other people asked questions on similar topics, check out the answers they received:


Q:

rebuild a railing

I would like to rebuild a railing on an existing deck using 4x4 posts. I want a 42" railing and privacy lattace of 42" above the ...
Submitted by Neil O'Donnell   4 months ago.
  • viewed 92 times


Q:

How to become installer of handicap products

becoming a handicap product installer
Submitted by edward   11 months ago.
  • viewed 64 times


Q:

Hi thanks for the article... i have a question ...

hi thanks for the article... i have a question regarding internet speed... if you have a server with unlimited bandwidth wouldnt ...
Submitted by Jonny   3 months ago.
  • viewed 191 times
Last answer posted 8 days ago by Dixie Brown



» More...

Feed - Subscribe to changes to this Q&A Blog
ADVERTISEMENT
  • Answers
  • Web
Copyright © 2006-2009, Yedda Inc. and respective copyright owners · CC License