Run rails new tailwind_test -c tailwind
Run bin/rails generate controller Articles index
Add root "articles#index" to routes.rb
Replace app/views/articles/index.html.erb with <h1 class="text-red-500">Hello, Rails!</h1>
Run bin/rails server and browse to http://localhost:3000
I expect the header to be red, but it's black instead. Am I missing something?
When I check http://localhost:3000/assets/tailwind-9feb1537dce11964234c16da844286da8664b423b40520df83683b2ce14c0961.css the Tailwind css is missing all the text utility classes and http://localhost:3000/assets/application-fe440406e54bdd95ec9046fd7f7b3f6803f9748857226012c8213a74c8350ae1.css contains
as if something wasn't resolved. I also tried running yarn build:css --watch in the project root dir, but that fails with error Couldn't find a package.json file in XXX.
This is on Rails 7.0.4, Ruby 3.1.2p20 and npm 8.19.2
Steps to reproduce:
Run
rails new tailwind_test -c tailwind
Runbin/rails generate controller Articles index
Addroot "articles#index"
toroutes.rb
Replaceapp/views/articles/index.html.erb
with<h1 class="text-red-500">Hello, Rails!</h1>
Runbin/rails server
and browse tohttp://localhost:3000
I expect the header to be red, but it's black instead. Am I missing something?
When I check
http://localhost:3000/assets/tailwind-9feb1537dce11964234c16da844286da8664b423b40520df83683b2ce14c0961.css
the Tailwind css is missing all the text utility classes andhttp://localhost:3000/assets/application-fe440406e54bdd95ec9046fd7f7b3f6803f9748857226012c8213a74c8350ae1.css
containsas if something wasn't resolved. I also tried running
yarn build:css --watch
in the project root dir, but that fails witherror Couldn't find a package.json file in XXX
.This is on Rails 7.0.4, Ruby 3.1.2p20 and npm 8.19.2