Rails 6 and Tailwind CSS does not deploy to Heroku

不羁岁月 提交于 2020-04-13 17:09:26

问题


I have a Rails 6 app that was successfully deployed to Heroku and worked on localhost:3000.

I added tailwindcss via yarn and webpack. It runs perfectly fine on localhost, but does not run on heroku. When I run heroku logs I get the following error

I've read all the Heroku Rails 6 Webpacker issues, and tried all the suggestions. Nothing worked.

  1. I have commented out <%= stylesheet_pack_tag %> ... didn't help
  2. I have toggled extract_css: true in webpacker.yml file .... didn't help
  3. I have run
    • heroku buildpacks:clear
    • heroku buildpacks:set heroku/nodejs
    • heroku buildpacks:add heroku/ruby ... didn't help

Does anyone have any idea what is going on?

My github repo is https://github.com/HundredBillion/enneagram


回答1:


I had the same problem with you but I tried this one and it worked for me.

Inside of config/webpacker.yml, you must set extract_css: true default is false.




回答2:


I have a few suggestions for you, let me know which one (if any) work for you.

In webpacker.yml for all instances of the below options

check_yarn_integrity: false
compile: true

Try

./bin/setup
rails webpacker:clobber
rails webpacker:compile

If none of the above work then perhaps one of these links will help: - https://github.com/tailwindcss/discuss/issues/4#issuecomment-341918136 - https://github.com/IcaliaLabs/tailwindcss-rails



来源:https://stackoverflow.com/questions/59831329/rails-6-and-tailwind-css-does-not-deploy-to-heroku

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!