Rails 6和Tailwind CSS不会部署到Heroku [英] Rails 6 and Tailwind CSS does not deploy to Heroku
问题描述
我有一个已成功部署到Heroku并在localhost:3000上运行过的Rails 6应用程序.
I have a Rails 6 app that was successfully deployed to Heroku and worked on localhost:3000.
我通过yarn和webpack添加了tailwindcss.它可以在localhost上正常运行,但不能在heroku上运行.当我运行heroku logs
时,出现以下错误
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
我已经阅读了所有Heroku Rails 6 Webpacker问题,并尝试了所有建议.没事.
I've read all the Heroku Rails 6 Webpacker issues, and tried all the suggestions. Nothing worked.
- 我已注释掉
<%= stylesheet_pack_tag %>
...没有帮助 - 我已在webpacker.yml文件中切换了
extract_css: true
....并没有帮助 - 我跑了
-
heroku buildpacks:clear
-
heroku buildpacks:set heroku/nodejs
-
heroku buildpacks:add heroku/ruby
...没有帮助
-
- I have commented out
<%= stylesheet_pack_tag %>
... didn't help - I have toggled
extract_css: true
in webpacker.yml file .... didn't help - 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?
我的github仓库是 https://github.com/HundredBillion/enneagram
My github repo is https://github.com/HundredBillion/enneagram
推荐答案
我对您也遇到了同样的问题,但是我尝试了这个问题,它对我有用.
I had the same problem with you but I tried this one and it worked for me.
在config/webpacker.yml内,必须设置extract_css:true缺省为false.
Inside of config/webpacker.yml, you must set extract_css: true default is false.
这篇关于Rails 6和Tailwind CSS不会部署到Heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!