Please help - Rails hanging on mysql connection


#1

Trying to get Rails and mysql running on OS X, and I’m a Nuby.
Everything ran smoothly when I first installed, but after rebooting
things were out of whack. I finally got back into mysql after
re-installing, and at first when I tried to connect with Rails/Ruby I
got a message that my client was not up to date. So after reading some
info online, I set my mysql passwords with OLD_PASSWORD. At that point,
Rails just started to hang when I tried to connect. Can anyone help?
Here is the error I get below. I only get this error to show up if I
stop the browser (it hangs while trying to load) and refresh. Tests and
other direct calls to the DB just hang (for example, the test says
“Starting” and then doesn’t do anything for minutes on end (simple
test).

NoMethodError in Organize#index

You have a nil object when you didn’t expect it!
The error occured while evaluating nil.each_hash

RAILS_ROOT: script/…/config/…
Application Trace | Framework Trace | Full Trace

/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:325:in
select' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:175:inselect_one’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/database_statements.rb:16:in
select_value' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:518:incount_by_sql’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:511:in
count' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/pagination.rb:167:incount_collection_for_pagination’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/pagination.rb:188:in
paginator_and_collection_for' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/pagination.rb:124:inpaginate’
./script/…/config/…/app/controllers/organize_controller.rb:8:in list' ./script/../config/../app/controllers/organize_controller.rb:3:inindex’

/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:325:in
select' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:175:inselect_one’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/database_statements.rb:16:in
select_value' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:518:incount_by_sql’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:511:in
count' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/pagination.rb:167:incount_collection_for_pagination’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/pagination.rb:188:in
paginator_and_collection_for' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/pagination.rb:124:inpaginate’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:853:in
send' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:853:inperform_action_without_filters’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/filters.rb:332:in
perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:inperform_action_without_rescue’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:in
measure' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:inperform_action_without_rescue’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/rescue.rb:82:in
perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:369:insend’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:369:in
process_without_session_management_support' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/session_management.rb:116:inprocess’
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:38:in
dispatch' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb:117:inhandle_dispatch’
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb:83:in
service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:inservice’
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/lib/ruby/1.8/webrick/server.rb:155:instart_thread’
/usr/lib/ruby/1.8/webrick/server.rb:144:in start' /usr/lib/ruby/1.8/webrick/server.rb:144:instart_thread’
/usr/lib/ruby/1.8/webrick/server.rb:94:in start' /usr/lib/ruby/1.8/webrick/server.rb:89:ineach’
/usr/lib/ruby/1.8/webrick/server.rb:89:in start' /usr/lib/ruby/1.8/webrick/server.rb:79:instart’
/usr/lib/ruby/1.8/webrick/server.rb:79:in start' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb:69:indispatch’
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/servers/webrick.rb:59
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in require__' /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:inrequire’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in
require' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/server.rb:28 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:inrequire__’
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:inrequire’
script/server:3

/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:325:in
select' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:175:inselect_one’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/database_statements.rb:16:in
select_value' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:518:incount_by_sql’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:511:in
count' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/pagination.rb:167:incount_collection_for_pagination’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/pagination.rb:188:in
paginator_and_collection_for' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/pagination.rb:124:inpaginate’
./script/…/config/…/app/controllers/organize_controller.rb:8:in list' ./script/../config/../app/controllers/organize_controller.rb:3:inindex’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:853:in
send' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:853:inperform_action_without_filters’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/filters.rb:332:in
perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:inperform_action_without_rescue’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:in
measure' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:inperform_action_without_rescue’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/rescue.rb:82:in
perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:369:insend’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:369:in
process_without_session_management_support' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/session_management.rb:116:inprocess’
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:38:in
dispatch' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb:117:inhandle_dispatch’
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb:83:in
service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:inservice’
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/lib/ruby/1.8/webrick/server.rb:155:instart_thread’
/usr/lib/ruby/1.8/webrick/server.rb:144:in start' /usr/lib/ruby/1.8/webrick/server.rb:144:instart_thread’
/usr/lib/ruby/1.8/webrick/server.rb:94:in start' /usr/lib/ruby/1.8/webrick/server.rb:89:ineach’
/usr/lib/ruby/1.8/webrick/server.rb:89:in start' /usr/lib/ruby/1.8/webrick/server.rb:79:instart’
/usr/lib/ruby/1.8/webrick/server.rb:79:in start' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb:69:indispatch’
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/servers/webrick.rb:59
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in require__' /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:inrequire’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in
require' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/server.rb:28 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:inrequire__’
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:inrequire’
script/server:3

Request

Parameters: None

Show session dump


flash: !ruby/hash:ActionController::Flash::FlashHash {}

Response
Headers: {“cookie”=>[], “Cache-Control”=>“no-cache”}


#2

On Jan 15, 2006, at 12:49 PM, Brian D. wrote:

stop the browser (it hangs while trying to load) and refresh.
Tests and
other direct calls to the DB just hang (for example, the test says
“Starting” and then doesn’t do anything for minutes on end (simple
test).

I had a similar problem. What version of MySQL are you using, and
how did you install it? I eventually backed out everything I had
done, installed the binary distribution of MySQL 5, and got it all
working again.

I have listed links to the resources I used to get this all working
on my blog.

http://blog.dragonsharp.com/?p=18

Regards, Lori


#3

I had a similar problem. What version of MySQL are you using, and
how did you install it? I eventually backed out everything I had
done, installed the binary distribution of MySQL 5, and got it all
working again.

Lori, thanks!! Thanks to those sites, I am back up and running. Being
an OS X newb, I have next to no idea what I did, why it worked at first,
then stopped, etc. I just ordered O’Reilly’s Running Mac OS X Tiger,
which is supposed to be a good intro to OS X for windows losers. Hoping
not to feel so clueless on the “other side.”

Thanks again!

Brian