Fixing Tailwind CSS Autocomplete in RubyMine (Rails 8 + Tailwind CSS 4)
If you’ve recently created a Rails 8 app with Tailwind CSS 4 and noticed that Tailwind class autocomplete doesn’t work in RubyMine you’re not alone.
This happens because RubyMine’s Tailwind CSS plugin expects a Node-based Tailwind CLI, while Rails now bundles Tailwind via cssbundling-rails, which doesn’t rely on Node or npm by default.
Good news: there’s a clean workaround.
Step 1: How Rails sets up Tailwind by default
When you create a new Rails app with the -c tailwind flag:
rails new myapp -c tailwind
Rails automatically:
• Installs Tailwind via cssbundling-rails.
configuration).
• Creates a app/assets/stylesheets/tailwind folder containing application.css.
That application.css file includes this line:
@import "tailwindcss";
When you run bin/dev
, Rails compiles Tailwind through its build pipeline (not Node), so Tailwind works perfectly in the browser.
However…
RubyMine’s Tailwind CSS plugin doesn’t know this setup yet so it doesn’t trigger autocomplete for class names inside your .erb, .html, or .turbo_stream.erb files.
Step 2: The Fix for RubyMine Autocomplete
To make RubyMine recognize Tailwind in your Rails 8 project, add one or both of the following tweaks.
Option A (Recommended – Minimal Fix)
Create a minimal package.json file in your project root:
echo '{"devDependencies": {"tailwindcss": "latest"}}' > package.json
This helps RubyMine detect that Tailwind exists, and autocomplete should start working immediately after restarting the IDE.
Option B (Optional – Full CLI Link)
If autocomplete still doesn’t trigger, you can make RubyMine think Tailwind CLI is installed via Node:
mkdir -p ./node_modules/tailwindcss/lib
ln -s tailwindcss node_modules/tailwindcss/lib/cli.js
This simply creates a soft link where RubyMine expects the Tailwind binary to live, no npm installation required.
Step 3: Restart RubyMine
Once you’ve done either step, restart RubyMine (or invalidate caches).
You should now get full Tailwind class suggestions and color previews when typing inside .html.erb and .html+turbo_stream.erb templates.
Your tailwind auto-suggest class names should show
Credits
Big thanks to Markus Wüstenberg and the JetBrains YouTrack thread for highlighting this workaround.
Top comments (0)