简体   繁体   中英

Rails app w/ Heroku - Home page doesn't exist

My app runs perfectly on my localhost, but when I push it to Heroku, my home page gives me a message that says 'The page you were looking for doesn't exist.' Other pages (not all, but most) within the app display correctly on Heroku. Here is the output from running heroku run cat config/routes.rb :

Running `cat config/routes.rb` attached to terminal... up, run.8019
SampleApp::Application.routes.draw do
  resources :users
  resources :sessions,      only: [:new, :create, :destroy]
  resources :relationships, only: [:create, :destroy]
  resources :teams
  resources :players
  resources :matchups

  root 'static_pages#home'
  match '/signup',  to: 'users#new',            via: 'get'
  match '/signin',  to: 'sessions#new',         via: 'get'
  match '/signout', to: 'sessions#destroy',     via: 'delete'
  match '/help',    to: 'static_pages#help',    via: 'get'
  match '/about',   to: 'static_pages#about',   via: 'get'
  match '/contact', to: 'static_pages#contact', via: 'get'
  match '/updatepts', to: 'static_pages#updatepts', via: 'get'
  match '/findMatchup', to: 'static_pages#findMatchup', via: 'get'

The other page that notably does not display is matchups/:id . Any ideas as to why this is displaying with no problem locally, but will not work on Heroku? Thanks!

Edit: I am running Rails 4 w/ Ruby 2.

我的根本问题是,正在主页上渲染的部分内容(而另一个页面未显示)正在调用一个为nil的字段,因为heroku数据库中的数据不如本地数据库中的数据那么广泛。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM