views:

324

answers:

2

My Environments:

CentOS 5
ruby 1.8.6 (2008-08-11 patchlevel 287) [x86_64-linux]
Ruby Enterprise Edition 20090610
passneger or webrick

I use this gem list.

*** LOCAL GEMS ***
actionmailer (2.3.2, 2.2.2)
actionpack (2.3.2, 2.2.2)
activerecord (2.3.2, 2.2.2)
activeresource (2.3.2, 2.2.2)
activesupport (2.3.2, 2.2.2)
fastthread (1.0.7)
haml (2.2.13)
mysql (2.7)
passenger (2.2.2)
rack (1.0.0)
rails (2.3.2, 2.2.2)
rake (0.8.7)
rmagick (2.9.2)
sqlite3-ruby (1.2.4)
will_paginate (2.2.2)

This is the error message. I don't know how can i solve it. Please help me.

When I use webrick:

Processing DashboardController#index (for 114.204.152.246 at 2009-11-14 10:52:57) [GET]

ArgumentError (Cannot yield from a Proc type filter. The Proc must take two arguments and execute #call on the second argument.):
  haml (2.2.5) [v] rails/./lib/sass/plugin/rails.rb:19:in `process'
  /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
  /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
  /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/1.8/webrick/server.rb:162:in `start'
  /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
  /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/1.8/webrick/server.rb:95:in `start'
  /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/1.8/webrick/server.rb:92:in `each'
  /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/1.8/webrick/server.rb:92:in `start'
  /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/1.8/webrick/server.rb:23:in `start'
  /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/1.8/webrick/server.rb:82:in `start'

Rendering /var/rails/powerdns-on-rails/public/500.html (500 Internal Server Error)

When I use passenger:

Processing DashboardController#index (for 114.204.152.246 at 2009-11-14 10:22:50) [GET]

ArgumentError (Cannot yield from a Proc type filter. The Proc must take two arguments and execute #call on the second argument.):
  haml (2.2.5) [v] rails/./lib/sass/plugin/rails.rb:19:in `process'
  passenger (2.2.2) lib/phusion_passenger/rack/request_handler.rb:81:in `process_request'
  passenger (2.2.2) lib/phusion_passenger/abstract_request_handler.rb:203:in `main_loop'
  passenger (2.2.2) lib/phusion_passenger/railz/application_spawner.rb:340:in `start_request_handler'
  passenger (2.2.2) lib/phusion_passenger/railz/application_spawner.rb:298:in `handle_spawn_application'
  passenger (2.2.2) lib/phusion_passenger/utils.rb:181:in `safe_fork'
  passenger (2.2.2) lib/phusion_passenger/railz/application_spawner.rb:296:in `handle_spawn_application'
  passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:337:in `__send__'
  passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:337:in `main_loop'
  passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:187:in `start_synchronously'
  passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:154:in `start'
  passenger (2.2.2) lib/phusion_passenger/railz/application_spawner.rb:192:in `start'
  passenger (2.2.2) lib/phusion_passenger/spawn_manager.rb:257:in `spawn_rails_application'
  passenger (2.2.2) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
  passenger (2.2.2) lib/phusion_passenger/spawn_manager.rb:251:in `spawn_rails_application'
  passenger (2.2.2) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
  passenger (2.2.2) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  passenger (2.2.2) lib/phusion_passenger/spawn_manager.rb:250:in `spawn_rails_application'
  passenger (2.2.2) lib/phusion_passenger/spawn_manager.rb:153:in `spawn_application'
  passenger (2.2.2) lib/phusion_passenger/spawn_manager.rb:282:in `handle_spawn_application'
  passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:337:in `__send__'
  passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:337:in `main_loop'
  passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:187:in `start_synchronously'

Rendering /var/rails/powerdns-on-rails/public/500.html (500 Internal Server Error)
A: 

I was stuck on this as well and while I can't give you an explanation of the problem, I can tell you that upgrading to REE 1.8.7 fixed it for me. I'm guessing it was some issue with ruby 1.8.6 that was exposed by the rails patch, but that's just a guess.

By the way, if you want to see the rails commit that introduced that "Can not yield from a Proc" error, go take a look at http://dev.rubyonrails.org/changeset/5163

Hope that helps.

Jeff Whitmire
A: 

I had same problem, but my ruby are allready 1.8.7. Ok, check out this article http://citizen428.net/archives/846, my solution was

after_save :callback

define_method :callback do
# do somethink
end

changed to

after_save :callback

def callback do
# do somethink
end

jsd