【问题标题】:Deploying Rails with Elastic Beanstalk 404 Not Found Error使用 Elastic Beanstalk 部署 Rails 404 Not Found 错误
【发布时间】:2014-03-04 02:44:00
【问题描述】:

我正在尝试使用 Elastic Beanstalk 部署我的 Ruby on Rails 应用程序。我正在关注本指南 - http://ruby.awsblog.com/post/Tx2AK2MFX0QHRIO/Deploying-Ruby-Applications-to-AWS-Elastic-Beanstalk-with-Git

但不幸的是,当我访问该网站时,它会显示

404 未找到 nginx/1.4.3

eb status --verbose 给出了这个:

Retrieving status of environment "SurveyMe".
URL             : SurveyMe-i5dkejjacp.elasticbeanstalk.com
Status          : Ready
Health          : Green
Environment Name: SurveyMe
Environment ID  : e-rtzrvemw53
Environment Tier: WebServer::Standard::1.0
Solution Stack  : 64bit Amazon Linux 2013.09 running Ruby 1.9.3
Version Label   : git-b2f153a095a4392b2c77a9e40a3bd91acf02757e-1391723347993
Date Created    : 2014-02-06 21:36:28
Date Updated    : 2014-02-06 21:49:37
Description     :

我看到了一些类似问题的问题,但大多数在这里都有错误。任何想法可能会发生什么或要检查什么?该应用程序当前与 Heroku 一起部署 - 这可能是个问题吗?

包括我的 routes.rb

SurveyMe::Application.routes.draw do
  devise_for :developers
  devise_for :users
  mount Rapidfire::Engine => "/surveys"
  root :to => "static_pages#home"
  match "/about", to: "static_pages#use", via: "get"
  match "/developers", to: "static_pages#developer" , via: "get"
  match "/how", to: "static_pages#how", via: "get"

【问题讨论】:

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


    【解决方案1】:

    假设它是 Rails 应用程序。检查您的路线:

    <your app dir>/config/routes.rb
    

    你应该为根路由定义一些东西:

    # Application home
    root :to => 'welcome#index'
    

    【讨论】:

    • 不幸的是同样的问题。我在上面添加了我的 routes.rb 文件 - 之前该行只是根“static_pages#home”,但我根据您的建议对其进行了更新。
    猜你喜欢
    • 2020-12-12
    • 2016-03-04
    • 2020-12-11
    • 2018-12-03
    • 2016-09-24
    • 2013-08-31
    • 2016-09-18
    • 1970-01-01
    相关资源
    最近更新 更多