我正在尝试使用 tailwind 设置我的 Rails 项目,但浏览器中没有显示任何实际的 tailwind 更改。在 devtools 中会显示该类,但它不会在浏览器中进行任何更改(背景不是红色)。RoR版本是7.0.1,Tailwindcss是3.0.13,Ruby是2.7.2。我按照https://www.youtube.com/watch?v=JsNtLiph87Y进行设置,这是我的 tailwind.config:
module.exports = {
content: [
'./app/views/**/*.html.erb',
'./app/helpers/**/*.rb',
'./app/javascript/**/*.js'
],
mode: 'jit',
}
Run Code Online (Sandbox Code Playgroud)
这是我的 Gemfile:
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "2.7.2"
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.0.1"
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem "sprockets-rails"
# Use postgresql as the database for Active Record
gem "pg", "~> 1.1"
# Use the Puma web server [https://github.com/puma/puma] …Run Code Online (Sandbox Code Playgroud)