在 heroku 上部署 Rails 应用程序获取路径错误

Deploying Rails App on heroku Get path error

我正在 heroku 上部署我的 rails 应用程序,我遇到了一个问题。

我收到这个错误

2015-04-28T05:10:29.159894+00:00 heroku[router]: at=info method=GET path="/welcome/index" host=still-dawn-6484.herokuapp.com request_id=45bf4295-d7f0-4788-9f4d-be35cce41aa1 fwd="108.183.45.173" dyno=web.1 connect=0ms service=11ms status=500 bytes=1754

我的路线文件

Rails.application.routes.draw do
   get 'welcome/index', to: 'welcome#index'
  post 'welcome/index', to: 'welcome#create'
  get 'welcome/new', to: 'welcome#new'


end

首先检查您是否为每个方法创建了所有模板。您是否检查过您的应用程序在本地系统中以 development 模式运行?如果它抛出错误,那么首先跟踪该错误并修复。然后只尝试 production

尝试像这样更改您的路由文件:

Rails.application.routes.draw do
  root 'welcome#index' #to make it main page(default)
  post '/welcomes', to: 'welcome#create'
  get 'welcome/new', to: 'welcome#new'
end

让我知道它是否适合你?如果您遇到任何问题,请告诉我。我会相应地更新我的答案。