将Ruby on Rails部署到Elastic Bean-Stalk路由错误

时间:2016-01-05 21:42:19

标签: ruby-on-rails amazon-web-services routing elastic-beanstalk

我刚刚在Elastic Bean-Stalk(AWS)上部署了一个Ruby on Rails应用程序。当我尝试访问应用程序的URL时,我在日志文件中获得以下行。这个问题可能是什么原因?它来自Gemlist吗?生产需要什么宝石?!

func tableView(tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let cell = tableView.cellForRow(at: indexPath) as! CustomTableViewCell
cell.bgImage.image = UIImage(named: "second_image")}

1 个答案:

答案 0 :(得分:0)

ElasticBeanstalk现在通过向根路径发出HEAD请求来检查应用程序的运行状况。此HEAD请求的响应状态必须为200,才能在OK(绿色)运行状况中考虑您的应用。 Here's a link with more info

要解决此问题,请在routes.rb中将root连接到将返回任何响应的控制器方法。

例如:

class HealthController < ApplicationController #health_controller.rb
  def index
    render json: {status: 'success'}
  end
end


# routes.rb
Rails.application.routes.draw do
  # The priority is based upon order of creation: first created -> highest priority.
  # See how all your routes lay out with "rake routes".

  # You can have the root of your site routed with "root"
  root 'health#index'
  ...
end