# We're sorry, but something went wrong(500)

**URL:** <https://www.ruby-forum.com/t/were-sorry-but-something-went-wrong-500/180917>\
**Category:** Rails\
**Created:** [December 31, 2009, 3:42pm UTC](https://www.ruby-forum.com/t/were-sorry-but-something-went-wrong-500/180917 "2009-12-31T15:42:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [December 31, 2009, 3:42pm UTC](https://www.ruby-forum.com/t/were-sorry-but-something-went-wrong-500/180917/1 "2009-12-31T15:42:12Z")

</div>

Hi all,

Thankfully, my site is now live. It needs some tweaks, but most  
importantly I need to fix the 500 internal server error I seem to be  
getting.

We’re sorry, but something went wrong(500), We’ve been notified about  
this issue and we’ll take a look at it shortly.

When I look at the log, it says:

NoMethodError (undefined method `find_by_user_id' for #<Class: 0xb5f1b188>): app/controllers/user_controller.rb:32:in `index’  
/usr/lib/ruby/1.8/phusion\_passenger/rack/request\_handler.rb:92:in  
`process_request' /usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb: 207:in `main\_loop’  
/usr/lib/ruby/1.8/phusion\_passenger/railz/application\_spawner.rb:  
385:in `start_request_handler' /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb: 343:in `handle\_spawn\_application’  
/usr/lib/ruby/1.8/phusion\_passenger/utils.rb:184:in `safe_fork' /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb: 341:in `handle\_spawn\_application’  
/usr/lib/ruby/1.8/phusion\_passenger/abstract\_server.rb:352:in  
` __send__' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main\_loop’  
/usr/lib/ruby/1.8/phusion\_passenger/abstract\_server.rb:196:in  
`start_synchronously' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:163:in `start’  
/usr/lib/ruby/1.8/phusion\_passenger/railz/application\_spawner.rb:  
209:in `start' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:262:in `spawn\_rails\_application’  
/usr/lib/ruby/1.8/phusion\_passenger/abstract\_server\_collection.rb:  
126:in `lookup_or_add' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:256:in `spawn\_rails\_application’  
/usr/lib/ruby/1.8/phusion\_passenger/abstract\_server\_collection.rb:  
80:in `synchronize' /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb: 79:in `synchronize’  
/usr/lib/ruby/1.8/phusion\_passenger/spawn\_manager.rb:255:in  
`spawn_rails_application' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:154:in `spawn\_application’  
/usr/lib/ruby/1.8/phusion\_passenger/spawn\_manager.rb:287:in  
`handle_spawn_application' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in ` **send** ’  
/usr/lib/ruby/1.8/phusion\_passenger/abstract\_server.rb:352:in  
`main_loop' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start\_synchronously’  
/usr/lib/phusion\_passenger/passenger-spawn-server:61

So - the undefined method `find\_by\_user\_id line in the user\_controller  
says:  
@posts = Post.find\_by\_user.id( @user.id, 1, :limit =\> 1, :conditions  
=\> “active\_post = 1”, :order =\> “created\_at desc”)

THis worked perfectly fine in development, so I dont understand why it  
hasn’t rendered the page as it did in prod.

Has anyone else come across this issue before? If so - how/what do I  
need to do to resolve it?

Many, many thanks (happy new year too!!) 🙂

🙂

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [December 31, 2009, 4:05pm UTC](https://www.ruby-forum.com/t/were-sorry-but-something-went-wrong-500/180917/2 "2009-12-31T16:05:37Z")

</div>

I’m going to go out on a limb & say that you did not perform your  
migrations in the production environment. The find\_by\* methods are  
dynamically generated. No find\_by\_user\_id method =\> no user\_id  
column.

On Dec 31, 8:36 am, RubyonRails\_newbie [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> 343:in `handle_spawn_application' `start’  
> /usr/lib/ruby/1.8/phusion\_passenger/abstract\_server\_collection.rb:  
> `main\_loop’  
> hasn’t rendered the page as it did in prod.
> 
> Has anyone else come across this issue before? If so - how/what do I  
> need to do to resolve it?
> 
> Many, many thanks (happy new year too!!) 🙂
> 
> 🙂

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [December 31, 2009, 4:13pm UTC](https://www.ruby-forum.com/t/were-sorry-but-something-went-wrong-500/180917/3 "2009-12-31T16:13:13Z")

</div>

Yeah good spot.

I avoided rake db:migrate because of my error posted yesterday that  
returned:  
rake aborted!  
undefined method `reenable’ for \<Rake::Task db:schema:dump =\>  
[environment]\>:Rake::Task

So I understand your reply, but I don’t know how to fix it… Is there  
a solution besides manually adding in the additional columns myself?

On Dec 31, 3:04 pm, Student [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Hi all,  
> > NoMethodError (undefined method `find_by_user_id' for #<Class: /usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:in `safe\_fork’  
> > /usr/lib/ruby/1.8/phusion\_passenger/railz/application\_spawner.rb:  
> > 79:in `synchronize’  
> > /usr/lib/ruby/1.8/phusion\_passenger/abstract\_server.rb:196:in
> 
> > Has anyone else come across this issue before? If so - how/what do I  
> > need to do to resolve it?
> 
> > Many, many thanks (happy new year too!!) 🙂
> 
> > 🙂

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [December 31, 2009, 4:24pm UTC](https://www.ruby-forum.com/t/were-sorry-but-something-went-wrong-500/180917/4 "2009-12-31T16:24:56Z")

</div>

I’ve not kept up with migrations, as we have to use a different method  
here. You definitely want to fix your migrations, though.  
Priorities, priorities…

On Dec 31, 9:11 am, RubyonRails\_newbie [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > > Hi all,  
> > > NoMethodError (undefined method `find_by_user_id' for #<Class: /usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:in `safe\_fork’  
> > > /usr/lib/ruby/1.8/phusion\_passenger/railz/application\_spawner.rb:  
> > > 79:in `synchronize’  
> > > /usr/lib/ruby/1.8/phusion\_passenger/abstract\_server.rb:196:in
> 
> > > Has anyone else come across this issue before? If so - how/what do I  
> > > need to do to resolve it?
> 
> > > Many, many thanks (happy new year too!!) 🙂
> 
> > > 🙂

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [December 31, 2009, 4:29pm UTC](https://www.ruby-forum.com/t/were-sorry-but-something-went-wrong-500/180917/5 "2009-12-31T16:29:37Z")

</div>

2009/12/31 RubyonRails\_newbie [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Yeah good spot.
> 
> I avoided rake db:migrate because of my error posted yesterday that  
> returned:  
> rake aborted!  
> undefined method `reenable’ for \<Rake::Task db:schema:dump =\>  
> [environment]\>:Rake::Task
> 
> So I understand your reply, but I don’t know how to fix it… Is there  
> a solution besides manually adding in the additional columns myself?

If your table needs a user\_id column then it is not surprising that it  
does not work if you have not provided that column. I think you will  
either have to fix the migration or add the column manually. If you  
add it manually then when you get the migrations working you will have  
further problems to work around as the db will be out of phase with  
the migrations.

Colin

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [December 31, 2009, 4:45pm UTC](https://www.ruby-forum.com/t/were-sorry-but-something-went-wrong-500/180917/6 "2009-12-31T16:45:25Z")

</div>

Thanks for that ,

I can add it manually, but as you say I’ll always be out of sync. I’ll  
dig a bit deeper.

Thank you

On 31 Dec, 15:27, Colin L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > So I understand your reply, but I don’t know how to fix it… Is there  
> > a solution besides manually adding in the additional columns myself?
> 
> If your table needs a user\_id column then it is not surprising that it  
> does not work if you have not provided that column. I think you will  
> either have to fix the migration or add the column manually. If you  
> add it manually then when you get the migrations working you will have  
> further problems to work around as the db will be out of phase with  
> the migrations.
> 
> Colin

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).
