# ActiveRecord failure, or something else?

**URL:** <https://www.ruby-forum.com/t/activerecord-failure-or-something-else/143948>\
**Category:** Rails\
**Created:** [July 24, 2008, 3:10am UTC](https://www.ruby-forum.com/t/activerecord-failure-or-something-else/143948 "2008-07-24T03:10:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![binary011010](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a587f6/32.png) [@binary011010](https://www.ruby-forum.com/u/binary011010)\
**Post date:** [July 24, 2008, 3:10am UTC](https://www.ruby-forum.com/t/activerecord-failure-or-something-else/143948/1 "2008-07-24T03:10:23Z")

</div>

I’ll try not to complicate this more than need be. I have been working  
on a rails project for several months. Not long ago, I decided to  
upgrade to rails 2.1.0 and ever since then I’ve been getting an error  
while taking one particular action. And not just an error, I get:  
Illegal instruction: 4 (core dumped)  
And the whole process dies. So here’s the details:  
FreeBSD 6.0  
ruby 1.8.6 (2007-09-24 patchlevel 111)  
Rails / ActiveRecord 2.1.0  
Mongrel 1.1.5

The error always occurs when I’m iterating over items that are joined to  
my model using has\_many :through, and I assume this is part of it. Since  
this started happening I tried changing the db adapter that I was using  
(from the standard PostreSQL adapter to the postgres-pr one), as well as  
changing databases from Postgres to MySQL, and neither of those changes  
made any difference. However, when I revert back to rails 2.0.2 (in the  
environment.rb file), everything works again! This leads me to believe  
that the problem is within ActiveRecord, but I can’t find anything about  
that anywhere.

Anyway, here’s one instance of offending code. Anyone have any ideas?  
Thanks

From the model:  
has\_many :family\_members  
has\_many :families, :through =\> :family\_members

From the controller:  
@person = Person.find(params[:id])  
@person.families.each do |f|  
result += f.identifier + “  
”  
end
