Rails教程chapter3 heroku找不到控制器StaticPagesController

我的教程中的sample_app有一个页面不存在问题。 我只是按照所有步骤操作,我的代码如下所示:

路线

Rails.application.routes.draw do root 'static_pages#home' get 'static_pages/home' get 'static_pages/help' get 'static_pages/about' get 'static_pages/contact' end 

Controller – 文件名是static_pages_controller.rb

 class StaticPagesController < ApplicationController def home end def help end def about end def contact end end 

在GET“/”我得到了

 ActionController::RoutingError (uninitialized constant StaticPagesController) 

看起来它找不到我的控制器。

感谢任何帮助Andrej