amazon web services - Deploy Ruby on Rails to Elastic Bean-Stalk route errors -
i deployed ruby on rails application on elastic bean-stalk (aws). when try visit url of app, following lines in log file. cause of issue ? gemlist ? gems need production ?!
------------------------------------- /var/app/support/logs/production.log ------------------------------------- ... i, [2016-01-05t21:12:14.107404 #22655] info -- : started head "/" 127.0.0.1 @ 2016-01-05 21:12:14 +0000 f, [2016-01-05t21:12:14.179737 #22655] fatal -- : actioncontroller::routingerror (no route matches [head] "/"): actionpack (4.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' actionpack (4.2.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' railties (4.2.4) lib/rails/rack/logger.rb:38:in `call_app' railties (4.2.4) lib/rails/rack/logger.rb:20:in `block in call' activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `block in tagged' activesupport (4.2.4) lib/active_support/tagged_logging.rb:26:in `tagged' activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `tagged' railties (4.2.4) lib/rails/rack/logger.rb:20:in `call' actionpack (4.2.4) lib/action_dispatch/middleware/request_id.rb:21:in `call' rack (1.6.4) lib/rack/runtime.rb:18:in `call' activesupport (4.2.4) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' railties (4.2.4) lib/rails/engine.rb:518:in `call' railties (4.2.4) lib/rails/application.rb:165:in `call' passenger (4.0.59) lib/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request' passenger (4.0.59) lib/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request' passenger (4.0.59) lib/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop' passenger (4.0.59) lib/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'
elasticbeanstalk checks health of app making head request root path. response status of head request must 200 app considered in ok (green) health. here's link more info.
to solve this, in routes.rb, wire root controller method return response.
for example:
class healthcontroller < applicationcontroller #health_controller.rb def index render json: {status: 'success'} end end # routes.rb rails.application.routes.draw # priority based upon order of creation: first created -> highest priority. # see how routes lay out "rake routes". # can have root of site routed "root" root 'health#index' ... end
Comments
Post a Comment