Deploying to Heroku in /public of a rails app


#1

Hello there,

I have a rails website on Heroku and in /public folder I put my jekyll blog. However, assets are not loaded (so minima style is lost) in production: https://evening-stream-98510.herokuapp.com/blog

Could anyone give me a clue about that?


#2

Chrome’s Inspector is your friend, it will show you that the css path is invalid/404.

Usually this is cause your are in a sub folder and need to use the baseurl, but I tried adding /blog to your css url and it didn’t work.

Do you know what the actual path is to the css file?


#3

Thanks @rdyar

I deployed another app to Heroku following this tutorial. Look at the difference:

If you replace /blog with /assets/main.css, in Test you see the file, but in Real it doesn’t exist. So main css file is not being sent to Heroku.

The Heroku tutorial uses Ruby buildpack to run ‘rake assets:precompile’ but this action is taken during deployment. My problem is that in the Real project, my blog is separated from the rails webapp (2 different repositories). I build the jekyll blog and rsync /_site files to /public folder. So I guess I should do this precompile locally, but not sure about it neither how to do it.


#4

is jekyll handling the css or something else? I would think rsync would work.

I have never used Heroku/ruby buildpack, so not sure I can be much more help.

locally?


#5

@rdyar thanks a lot, but it was my mistake: /public/assets was in .gitignore. Don’t ask me why. :expressionless: