gpt4 book ai didi

ruby - 文件未在 Heroku 上创建

转载 作者:太空宇宙 更新时间:2023-11-03 16:51:27 27 4
gpt4 key购买 nike

我托管我的 Jekyll-based blog ( github code ) 在 Heroku 雪松堆上。

我通过 my Rakefile 构建 jekyll 文件:

namespace :assets do
desc 'Precompile assets'
task :precompile do
sh "bundle exec sass --update _scss:_css --style compressed"
sh "bundle exec jekyll"
end
end

这会将文件输出到 _site 目录,Rack 将从该目录提供文件。

这已经工作了一年多,并且在我博客的当前版本(两周前发布)上运行良好:

$ heroku run ls _site                                                                                                 
Running `ls _site` attached to terminal... up, run.9360
2012 404 apple-touch-icon.png back-end css front-end index.html politics public-domain.txt rss.xml
2013 410 assets config favicon.ico go.sh personal postsbytag robots.txt sitemap.xml

但是,每当我现在尝试发布任何东西,或者将相同版本的代码发布到 new app , _site 目录似乎没有创建:

$ git push git push git@heroku.com:robinwinslow-dev.git
...
http://robinwinslow-dev.herokuapp.com deployed to Heroku
...
$ heroku run ls _site --app robinwinslow-dev
Running `ls _site` attached to terminal... up, run.2577
ls: cannot access _site: No such file or directory

还有 site shows :

Internal Server Error
No such file or directory - _site/404/index.html

有谁知道为什么这会改变? Heroku 有什么变化吗?还是我突然做了什么蠢事?

最佳答案

我不知道为什么这首先起作用,因为 Heroku has a read-only file system .解决方案是在本地编译您的网站,包括所有 Assets ,将它们 checkin Git,然后将完整的 _site 目录推送到 Heroku。

关于ruby - 文件未在 Heroku 上创建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20585739/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com