LoginSignup
2
0

More than 1 year has passed since last update.

rails + tailwind でherokuにデプロイするとエラーになる

Last updated at Posted at 2023-01-30

概要

タイトルのままだが、rails + tailwindcss使ってherokuデプロイ時にエラーになる。
ちなみにローカルでは正常に動く。

前提

バージョン

  • Rails 7.0
  • tailwindcss 3.2.4

エラー内容

remote:        rake aborted!
remote:        SassC::SyntaxError: Error: Function rgb is missing argument $green.
remote:                on line 1 of stdin
remote:        >> dden]){--tw-divide-opacity:1;border-color:rgb(229 231 235/var(--tw-divide-op
remote:           ------------------------------------------^

解決方法

config/environments/production.rb
# 追記 or 書き換え
config.assets.css_compressor = nil

原因

sassc-railsとtailwindcss-railsが干渉してるっぽい。

参考サイトはこちら。
https://stackoverflow.com/questions/70662382/couldnt-deploy-rails-tailwind-on-heroku
検索キーワード:tailwind heroku deploy SassC::SyntaxError

エラー内容もほぼ同じだった。。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0