Reputation: 46
I'm getting a "something went wrong" 500 error only in production on Heroku, and only for one of my pages which has very little almost entirely non-dynamic content.
In the logs, it's showing the following:
ActionView::MissingTemplate (Missing template pages/contact, application/contact with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee, :haml]}. Searched in:
2013-03-28T03:42:28+00:00 app[web.1]: * "/app/app/views"
2013-03-28T03:42:28+00:00 app[web.1]:
However, the template is definitely at that location. Heroku run rake routes shows the correct route. I followed the advice in other forums and moved uglifier, coffeescript, and haml-rails out of the assets group of my gemfile. Gemfile now looks like this:
source 'http://rubygems.org'
gem 'mail'
gem 'rails', '3.2.13'
gem 'pg'
gem 'twitter'
gem 'jquery-rails'
gem 'rake', '10.0.4'
gem 'sass', "~> 3.2.7"
gem 'haml-rails'
gem 'coffee-rails'
gem 'uglifier'
gem 'therubyracer'
gem 'sass-rails'
group :development do
gem 'rspec-rails'
gem 'annotate'
gem 'faker', '0.3.1'
end
group :test do
gem 'ruby-debug19', :require => 'ruby-debug'
gem 'rspec-rails'
gem 'webrat', '0.7.1'
gem 'spork', '0.9.0.rc8'
gem 'factory_girl_rails', '1.0'
gem 'autotest', '4.4.6'
gem 'autotest-rails-pure', '4.1.2'
gem 'autotest-fsevent', '0.2.5'
gem 'autotest-growl', '0.2.9'
gem 'ZenTest' , '4.8.3'
end
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'aws-s3', :require => 'aws/s3'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
# gem 'webrat'
# end
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
I'm not seeing anything else helpful in the logs or in other Stack Overflow questions. Any fresh eyes out there see something I don't?
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_view/renderer/template_renderer.rb:34:in `determine_template'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_view/renderer/renderer.rb:36:in `render_template'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/streaming.rb:225:in `_render_template'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/rendering.rb:110:in `_render_template'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_view/renderer/renderer.rb:17:in `render'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
2013-03-28T03:42:28+00:00 app[web.1]:
2013-03-28T03:42:28+00:00 app[web.1]: ActionView::MissingTemplate (Missing template pages/contact, application/contact with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee, :haml]}. Searched in:
2013-03-28T03:42:28+00:00 app[web.1]: * "/app/app/views"
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_view/renderer/abstract_renderer.rb:3:in `find_template'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/rendering.rb:103:in `render_to_body'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_view/lookup_context.rb:109:in `find'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_view/renderer/template_renderer.rb:10:in `render'
2013-03-28T03:42:28+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:39:in `render'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/rendering.rb:88:in `render'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_view/path_set.rb:58:in `find'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/rendering.rb:16:in `render'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actio
npack-3.2.13/lib/action_controller/metal/renderers.rb:28:in `render_to_body'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/rendering.rb:10:in `process_action'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/implicit_render.rb:10:in `default_render'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/core_ext/benchmark.rb:5:in `ms'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/implicit_render.rb:5:in `send_action'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:40:in `block in render'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:in `run_callbacks'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:414:in `_run__115463730327225923__process_action__2482471898787976109__callbacks'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `__run_callback'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/base.rb:167:in `process_action'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/notifications.rb:123:in `instrument'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/rescue.rb:29:in `process_action'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/base.rb:121:in `process'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/rendering.rb:45:in `process'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/notifications.rb:123:in `block in instrument'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/callbacks.rb:17:in `process_action'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal.rb:246:in `block in action'
2013-03-28T03:42:27+00:00 heroku[router]: at=info method=GET path=/contact host=polar-plains-8193.herokuapp.com fwd="98.164.80.126" dyno=web.1 connect=3ms service=15ms status=500 bytes=643
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal.rb:203:in `dispatch'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/etag.rb:23:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:73:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/conditionalget.rb:25:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/head.rb:14:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/flash.rb:242:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `_run__402893550312028338__call__2852970105878458306__callbacks'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `__run_callback'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:in `run_callbacks'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/rack/logger.rb:32:in `call_app'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/cookies.rb:341:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:
36:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210:in `context'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:612:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/tagged_logging.rb:22:in `tagged'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/request_id.rb:22:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:in `block in call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/query_cache.rb:64:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:223:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/static.rb:63:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
2013-03-28T03:42:28+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
2013-03-28T03:42:28+00:00 app[web.1]:
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:479:in `call'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in `service'
2013-03-28T03:42:28+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
2013-03-28T03:42:28+00:00 app[web.1]:
2013-03-28T03:42:28+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/rack/log_tailer.rb:17:in `call'
Upvotes: 0
Views: 895
Reputation: 46
Before giving up, I decided on a really weird hail mary hunch for a workaround and it solved the problem.
I copied and pasted the files in question "contact.html.erb", "contact.css.erb" into new mirror image files with the name "contacto.html.erb" etc. in place of "contact".
Changed the route to: match '/contact' => 'pages#contacto' and pushed to heroku. Error gone. Even more surprisingly, after I deleted the originals and renamed those same files with "contact" in place of contacto, it still worked.
I really don't understand what voodoo was behind this working. I was originally just trying a routing workaround. I'd even deleted all of the content from those "contact" files earlier and pushed them to heroku, replaced all of that content and pushed them again, without any change.
Upvotes: 0
Reputation: 4943
To confirm that the contact.html.erb made it to Heroku, try running the following:
heroku run bash
cat app/views/pages/contact.html.erb
Upvotes: 2