Search code examples
ruby-on-railsherokurenderpartial

Undefined method `call' for :silence:Symbol error


I have a Rails app, that works just fine on my development machine, but when I deploy it to Heroku I get the following error message when trying to load the page after it has been deployed..

ActionView::Template::Error (undefined method `call' for :silence:Symbol):

31: <div id="tickets">
32:      <div id="subline">Tickets open for trading</div>
33:           <% if not @tickets.blank? %>
34:                <%= render( :partial => '/choices/choice.html.erb', :locals => { :choice => @tickets} ) %>
35:           <% end %>
36:      </div>

app/views/home/index.html.erb:34:in `_app_views_home_index_html_erb___4151329774010405498_38984040'
app/controllers/home_controller.rb:108:in `index'

I can't seem to figure out what is wrong since it works just fine on my own machine so any help would be very much appriciated :)

EDIT 1:

Here is part of my Home controller, that is relevant for the above..

class HomeController < ApplicationController

  def index
    @tickets  = Choice.betable(current_user).where("choices.created_at > ?", Time.at(params[:after].to_i + 1).utc).order("choices.created_at DESC")

    respond_to do |format|
      format.html      
      format.json do
        @html_choice            = render_to_string( :partial => '/choices/choice.html.erb', :locals => { :choice => @tickets} )
        @html_active_choices    = render_to_string( :partial => '/shared/active_choices.html.erb', :locals => { :active_choices => @active_choices} )
        @html_active_bets       = render_to_string( :partial => '/shared/active_bets.html.erb', :locals => { :active_bets => @active_bets} )
        @html_spotprices_today  = render_to_string( :partial => '/shared/spotprices_today.html.erb', :locals => { :spotprices_today => @spotprices_today} )

        render :json => { :success => true, :html_choice => @html_choice, :html_active_choices => @html_active_choices, :html_active_bets => @html_active_bets, :html_spotprices_today => @html_spotprices_today  }
      end
    end
  end
end

The json responds are uses by [Pusher][1] to do a websocket push of updated data to the site.

Below you find the log file:

2012-11-12T06:04:20+00:00 app[web.1]: => Booting Thin
2012-11-12T06:04:20+00:00 app[web.1]: => Rails 3.2.8 application starting in production on http://0.0.0.0:40112
2012-11-12T06:04:20+00:00 app[web.1]: => Call with -d to detach
2012-11-12T06:04:20+00:00 app[web.1]: => Ctrl-C to shutdown server
2012-11-12T06:04:20+00:00 app[web.1]: >> Thin web server (v1.3.1 codename Triple Espresso)
2012-11-12T06:04:20+00:00 app[web.1]: >> Maximum connections set to 1024
2012-11-12T06:04:20+00:00 app[web.1]: >> Listening on 0.0.0.0:40112, CTRL+C to stop
2012-11-12T06:04:24+00:00 app[web.1]: 
2012-11-12T06:04:24+00:00 app[web.1]: 
2012-11-12T06:04:24+00:00 app[web.1]: Started GET "/rails/info/properties" for 157.55.34.32 at 2012-11-12 06:04:24 +0000
2012-11-12T06:04:24+00:00 heroku[router]: GET mydomain.com/rails/info/properties dyno=web.1 queue=0 wait=0ms service=51ms status=404 bytes=728
2012-11-12T06:04:24+00:00 heroku[nginx]: 157.55.34.32 - - [12/Nov/2012:06:04:24 +0000] "GET /rails/info/properties HTTP/1.1" 404 728 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" mydomain.com
2012-11-12T06:04:24+00:00 app[web.1]: 
2012-11-12T06:04:24+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/rails/info/properties"):
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/rack/logger.rb:26:in `call_app'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/rack/logger.rb:16:in `call'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/request_id.rb:22:in `call'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:479:in `call'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/application.rb:223:in `call'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/content_length.rb:14:in `call'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/rack/log_tailer.rb:17:in `call'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:80:in `block in pre_process'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:78:in `catch'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:78:in `pre_process'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:53:in `process'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:38:in `receive_data'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/backends/base.rb:61:in `start'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/server.rb:159:in `start'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/handler/thin.rb:13:in `run'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:55:in `block in <top (required)>'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:265:in `start'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands/server.rb:70:in `start'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'
2012-11-12T06:04:24+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:50:in `<top (required)>'
2012-11-12T06:04:24+00:00 app[web.1]:   script/rails:6:in `require'
2012-11-12T06:04:24+00:00 app[web.1]:   script/rails:6:in `<main>'
2012-11-12T06:04:24+00:00 app[web.1]: 
2012-11-12T06:04:24+00:00 app[web.1]: 
2012-11-12T08:56:34+00:00 heroku[router]: GET www.mydomain.com/ dyno=web.1 queue=0 wait=0ms service=607ms status=500 bytes=643
2012-11-12T08:56:34+00:00 heroku[nginx]: 87.60.190.9 - - [12/Nov/2012:08:56:34 +0000] "GET / HTTP/1.1" 500 643 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:14.0) Gecko/20100101 Firefox/14.0.1" www.mydomain.com

Hope this help in finding the cause for the error :)

Thanks!


Solution

  • Try change:
    ... :partial => '/choices/choice.html.erb'

    to:
    ... :partial => '/choices/choice'

    in your view and controller. To help your clearer, check Using Partial.