【问题标题】:Heroku ActionView::MissingTemplate (Missing template wordclouds/index, application/index)Heroku ActionView::MissingTemplate(缺少模板 wordclouds/index、application/index)
【发布时间】:2015-11-08 08:34:05
【问题描述】:

所以,我正在尝试将我的 Rails 应用程序部署到 Heroku。部署成功,但是当我导航到 Heroku url 时,我看到 Rails 标准“我们很抱歉,但出了点问题”消息。

我检查了 Heroku 日志,并在堆栈跟踪的顶部看到:

ActionView::MissingTemplate (Missing template wordclouds/index, application/index with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder]}. Searched in:
2015-11-07T19:17:23.924582+00:00 app[web.1]:   * "/app/app/views"

我肯定有一个有效的根路由,即wordclouds#index。在我的本地机器上,这个路由和索引视图在开发中表现得非常好。 Heroku 有什么不同?

另外,我的应用的所有源代码都是on GitHub

【问题讨论】:

    标签: ruby-on-rails heroku


    【解决方案1】:

    您似乎需要在文件夹 app/views/wordclouds 中添加一个文件“index.html.erb”

    【讨论】:

    • 谢谢 Ted,但是如果您查看我的代码,我已经在那个目录中拥有了那个文件,并且路由存在。
    • 对此感到抱歉......我试图点击 github 界面,而我应该拉它。有很多东西要学。感谢您向我介绍 git 子模块!
    • 没问题泰德! Git 子模块会引起很多麻烦。
    【解决方案2】:

    所以问题是app/views/wordclouds 已被初始化为一个 git 子模块,而 Heroku 就是不喜欢这样。一旦我删除了子模块,Heroku 就可以正常工作了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多