【问题标题】:Deploying heroku application - Internal Server Error部署 heroku 应用程序 - 内部服务器错误
【发布时间】:2013-01-14 12:56:34
【问题描述】:

我正在尝试将静态网页部署到 Heroku 并遵循以下内容: official tutorial

当我想在浏览器中查看我的页面时,我收到以下错误消息:

内部服务器错误 没有这样的文件或目录 - public/index.html WEBrick/1.3.1 (Ruby/1.9.2/2011-07-09) 在 dosasite2013.herokuapp.com:80

我的config.ru如下(根据官方教程)

使用机架::静态, :urls => ["/stylesheets", "/images"], :root => "公共" 运行 lambda { |env| [ 200, { '内容类型' => '文本/html', '缓存控制' => '公共,最大年龄 = 86400' }, File.open('public/index.html',File::RDONLY) ] }

当我通过 rackup 在内部运行应用程序时...public/index.html 页面显示正常...

Here is my link to directory structure

如何在 Heroku 上查看我的页面?

【问题讨论】:

标签: deployment heroku


【解决方案1】:

解决了。在config.ru文件中我把public/index.html改成了Public/index.html,和:root => "Public".一样

原因是我的目录以大写 P 开头,而不是小 'p'。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-11-23
    • 2013-07-22
    • 2019-06-18
    • 1970-01-01
    • 2021-10-14
    • 2021-11-30
    • 1970-01-01
    • 2011-03-05
    相关资源
    最近更新 更多