这是一个问题,同时更改了我的轨道的词根3.1项目:

我更新了config/routes.rb,将根指向自定义页面。

root :to => 'pages#home'

然后,我删除了现有的public/index.html。本地的一切都可以。

我跑了 git commit -am "message", ,结果是:delete mode 100644 public/index.html

我还犯下了新路由。RB以及所需的控制器和视图。

我推到Heroku: git push heroku master然后我跑了 heroku rake routes 结果是:

pages_home GET /pages/home(.:format)       {:controller=>"pages", :action=>"home"}
pages_formations GET /pages/formations(.:format) {:controller=>"pages", :action=>"formations"}
pages_music GET /pages/music(.:format)      {:controller=>"pages", :action=>"music"}
        root     /                           {:controller=>"pages", :action=>"home"}
        home     /home(.:format)             {:controller=>"pages", :action=>"home"}
  formations     /formations(.:format)       {:controller=>"pages", :action=>"formations"}
       music     /music(.:format)            {:controller=>"pages", :action=>"music"}

但是,如果我转到申请页面,我有一个空的白屏。如果我重置public/index.html,则显示此内容。

因此,似乎Heroku并未考虑我的修改。但是该提交有效:如果我在删除文件后克隆了该项目,我可以看到它已删除。

有帮助吗?

解决方案

白页通常意味着您在生产中有某种错误。处理此问题的最佳方法是检查Heroku上的生产登录:

heroku logs

并解决实际问题。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top