I host my Jekyll-based blog (github code) on a Heroku cedar stack.
I build the jekyll files through my Rakefile:
namespace :assets do
desc 'Precompile assets'
task :precompile do
sh "bundle exec sass --update _scss:_css --style compressed"
sh "bundle exec jekyll"
end
end
This outputs the files into a _site
directory, which is where Rack will serve the files from.
This has been working for over a year, and is working fine on the currently live version of my blog (released a fortnight ago):
$ 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
However, whenever I try to release anything now, or release the same version of the code to a new app, the _site
directory doesn't seem to be created:
$ git push git push [email protected]: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
And the site shows:
Internal Server Error
No such file or directory - _site/404/index.html
Does anyone know why this would have changed? Has anything changed in Heroku? Or have I suddenly done something stupid?
I don't know why this ever worked in the first place, because Heroku has a read-only file system. The solution would be to compile your site including all assets locally, check them into Git and then push the complete _site directory to Heroku.