Rails 6和Tailwind CSS不会部署到Heroku [英] Rails 6 and Tailwind CSS does not deploy to Heroku

查看:138
本文介绍了Rails 6和Tailwind CSS不会部署到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.

  1. 我已注释掉<%= stylesheet_pack_tag %> ...没有帮助
  2. 我已在webpacker.yml文件中切换了extract_css: true ....并没有帮助
  3. 我跑了
    • heroku buildpacks:clear
    • heroku buildpacks:set heroku/nodejs
    • heroku buildpacks:add heroku/ruby ...没有帮助
  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?

我的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆