Basic app troubleshoot

Dear board, I am running a fork of a quite large Rails 2.3.5 app (lots
of plugins etc.). It has worked before and I know it works on my
colleague’s machine. I’m not sure where to begin troubleshooting this
though (I can’t find much good Rails troubleshooting material
anywhere!). Can anyone help? Thanks in advance.

Browser output:

NoMethodError in Home#index

Showing app/views/home/index.html.erb where line #11 raised:

undefined method `alternative_url’ for #NewsItem:0x50cae18
Extracted source (around line #11):

8: :width => 499,
9: :height => 281,
10: :version => “9”,
11: :flashvars =>
front_page_panel_flashvars(@featured_panels),
12: :params => {:allowScriptAccess => “always”, :bgcolor
=> “1C1C1C”, :wmode => “transparent”},
13: :alt =>
(link_to(image_tag(@featured_panels.first.try(:image_path), :width =>
499, :height => 281), @featured_panels.first.try(:path)) unless
@featured_panels.empty?)
14: %>
RAILS_ROOT: /Users/matthew/Code/maloca

Application Trace | Framework Trace | Full Trace
/Users/matthew/.gem/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/attribute_methods.rb:260:in
method_missing' /Users/matthew/Code/maloca/app/models/news_item.rb:91:inpath’
/Users/matthew/.gem/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_proxy.rb:217:in
send' /Users/matthew/.gem/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_proxy.rb:217:inmethod_missing’
/Users/matthew/Code/maloca/app/helpers/home_helper.rb:4:in
front_page_panel_flashvars' /Users/matthew/Code/maloca/app/helpers/home_helper.rb:4:inmap’
/Users/matthew/Code/maloca/app/helpers/home_helper.rb:4:in
front_page_panel_flashvars' /Users/matthew/Code/maloca/app/views/home/index.html.erb:11:in_run_erb_app47views47home47index46html46erb’
/Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_view/renderable.rb:34:in
send' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_view/renderable.rb:34:inrender_without_trace_View_path_r_2_Rendering’
/Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_view/base.rb:306:in
with_template' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_view/renderable.rb:30:inrender_without_trace_View_path_r_2_Rendering’
/Users/matthew/Code/maloca/vendor/gems/newrelic_rpm-2.13.1/lib/new_relic/agent/method_tracer.rb:319:in
render' /Users/matthew/Code/maloca/vendor/gems/newrelic_rpm-2.13.1/lib/new_relic/agent/method_tracer.rb:141:intrace_execution_scoped’
/Users/matthew/Code/maloca/vendor/gems/newrelic_rpm-2.13.1/lib/new_relic/agent/method_tracer.rb:314:in
render' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_view/template.rb:205:inrender_template’
/Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_view/base.rb:265:in
render' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_view/base.rb:348:in_render_with_layout’
/Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_view/base.rb:262:in
render' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1250:inrender_for_file’
/Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:945:in
render_without_benchmark' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:51:inrender’
/Users/matthew/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in
ms' /Users/matthew/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:10:inrealtime’
/Users/matthew/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in
ms' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:51:inrender’
/Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1326:in
default_render' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1332:inperform_action_without_filters’
/Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:617:in
call_filters' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:610:inperform_action_without_benchmark’
/Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in
perform_action_without_rescue' /Users/matthew/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:inms’
/Users/matthew/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:10:in
realtime' /Users/matthew/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:inms’
/Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in
perform_action_without_rescue' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:160:inperform_action_without_flash’
/Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:in
perform_action_without_newrelic_trace' /Users/matthew/Code/maloca/vendor/gems/newrelic_rpm-2.13.1/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:254:inperform_action’
/Users/matthew/Code/maloca/vendor/gems/newrelic_rpm-2.13.1/lib/new_relic/agent/method_tracer.rb:141:in
trace_execution_scoped' /Users/matthew/Code/maloca/vendor/gems/newrelic_rpm-2.13.1/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:247:inperform_action’
/Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in
send' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:inprocess_without_filters’
/Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:606:in
process' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:inprocess’
/Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:in
call' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:437:incall’
/Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in
dispatch' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in_call’
/Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in
build_middleware_stack' /Users/matthew/Code/maloca/vendor/gems/newrelic_rpm-2.13.1/lib/new_relic/rack/developer_mode.rb:20:incall’
/Users/matthew/Code/maloca/vendor/gems/newrelic_rpm-2.13.1/lib/new_relic/rack/developer_mode.rb:20:in
call' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:incall’
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in call' /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:incall’
/Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in
call' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/session/abstract_store.rb:122:incall’
/Users/matthew/.gem/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in
call' /Users/matthew/.gem/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:incache’
/Users/matthew/.gem/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in
cache' /Users/matthew/.gem/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:incall’
/Users/matthew/.gem/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in
call' /Users/matthew/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/cache/strategy/local_cache.rb:24:incall’
/Users/matthew/Code/maloca/vendor/gems/hoptoad_notifier-2.3.8/lib/hoptoad_notifier/rack.rb:27:in
call' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:incall’
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in call' /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:insynchronize’
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in call' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:114:incall’
/Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:34:in
run' /Users/matthew/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:incall’
/Users/matthew/.gem/ruby/1.8/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in
call' /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:46:incall’
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in each' /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:incall’
/Users/matthew/.gem/ruby/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in
call' /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:13:incall’
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/chunked.rb:15:in call' /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:64:inprocess’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in
process_client' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:ineach’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in
process_client' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:inrun’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
initialize' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:innew’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in run' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:ininitialize’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in new' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:inrun’
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:34:in
run' /Users/matthew/.gem/ruby/1.8/gems/rails-2.3.5/lib/commands/server.rb:111 /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:ingem_original_require’
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require’
script/server:3
Request

Parameters:

{“section_id”=>1,
“language_id”=>3}
Show session dump


Response

Headers:

{“Content-Type”=>“text/html; charset=utf-8”,
“Cache-Control”=>“no-cache”}


Console error output:

Rendering home/index
NewsItem Columns (3.9ms) SHOW FIELDS FROM news
NewsItem Load (0.6ms) SELECT * FROM news WHERE (news.id =
6448)

ActionView::TemplateError (undefined method `alternative_url’ for
#NewsItem:0x50cb390) on line #11 of app/views/home/index.html.erb:
8: :width => 499,
9: :height => 281,
10: :version => “9”,
11: :flashvars =>
front_page_panel_flashvars(@featured_panels),
12: :params => {:allowScriptAccess => “always”, :bgcolor
=> “1C1C1C”, :wmode => “transparent”},
13: :alt =>
(link_to(image_tag(@featured_panels.first.try(:image_path), :width =>
499, :height => 281), @featured_panels.first.try(:path)) unless
@featured_panels.empty?)
14: %>

app/models/news_item.rb:91:in `path'
app/helpers/home_helper.rb:4:in `front_page_panel_flashvars'
app/helpers/home_helper.rb:4:in `map'
app/helpers/home_helper.rb:4:in `front_page_panel_flashvars'
app/views/home/index.html.erb:11
vendor/gems/newrelic_rpm-2.13.1/lib/new_relic/agent/method_tracer.rb:319:in

render' vendor/gems/newrelic_rpm-2.13.1/lib/new_relic/agent/method_tracer.rb:141:intrace_execution_scoped’
vendor/gems/newrelic_rpm-2.13.1/lib/new_relic/agent/method_tracer.rb:314:in
render' vendor/gems/newrelic_rpm-2.13.1/lib/new_relic/control/./agent/instrumentation/controller_instrumentation.rb:254:inperform_action’
vendor/gems/newrelic_rpm-2.13.1/lib/new_relic/agent/method_tracer.rb:141:in
trace_execution_scoped' vendor/gems/newrelic_rpm-2.13.1/lib/new_relic/control/./agent/instrumentation/controller_instrumentation.rb:247:inperform_action’
vendor/gems/newrelic_rpm-2.13.1/lib/new_relic/rack/developer_mode.rb:20:in
call' vendor/gems/newrelic_rpm-2.13.1/lib/new_relic/rack/developer_mode.rb:20:incall’
vendor/gems/hoptoad_notifier-2.3.8/lib/hoptoad_notifier/rack.rb:27:in
`call’

Rendered rescues/_trace (74.9ms)
Rendered rescues/_request_and_response (3.5ms)
Rendering rescues/layout (internal_server_error)


END

Thanks again!

On 3 February 2011 12:42, Matt G. [email protected] wrote:

12: :params => {:allowScriptAccess => “always”, :bgcolor
method_missing' /Users/matthew/Code/maloca/app/models/news_item.rb:91:inpath’

I would have a look at this line I think

Colin

Matt, I’ve never seen that kind of error ‘alternative_url’ before and
there is no reference pages on google.
Simply I guess that the error is saying there is no method
‘alternative_url’. Is that method you code yourself?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs