Ruby Sass CLI

Beginner
⏱️ 16 min read
📚 Updated: Jul 2026
🎯 5 Examples
Deprecated

What You’ll Learn

The Ruby Sass CLI was the original sass gem command line. This page explains how it worked (modes, styles, watch, source maps), how it differs from Dart Sass, and how to migrate—with five reference examples from the official docs.

01

Status

Deprecated / EOL

02

Modes

1:1 & many

03

--style

4 output styles

04

Watch

--watch / --update

05

Migrate

→ Dart Sass

06

Practice

5 examples

What Was the Ruby Sass CLI?

Ruby Sass shipped a sass executable (from the Ruby gem) that compiled .scss / .sass files to CSS. Like Dart Sass today, it had one-to-one and many-to-many modes, watch/update flags, and style options.

  • It is unmaintained—no security or language updates.
  • Default stdin / unknown extensions used the indented syntax (Dart Sass defaults to SCSS).
  • It offered four --style values; Dart Sass keeps two.
  • Features like --compass and --require tied it to the Ruby ecosystem.
💡
Beginner tip

If you are learning Sass in 2026, skip installing Ruby Sass. Install Dart Sass and practice with the Dart Sass CLI. Read this page when you meet an old Gemfile or Capistrano script.

📄 One-to-One Mode

terminal
sass [input.scss] [output.css]

Compiled one input to one output. No output path printed CSS to the terminal. No input or output meant read from stdin and print CSS. Extensions: .scss → SCSS, .sass → indented. Otherwise (and for stdin), indented was the default—use --scss to force SCSS.

📦 Many-to-Many Mode

Enabled when any argument contains a colon, or when --update / --watch is passed. Directory compiles skipped _partials. Unlike a pure one-shot Dart folder compile, Ruby many-to-many also behaved like an update: it compiled only when sources were newer than the CSS.

terminal
sass style.scss:style.css
sass light.scss:light.css dark.scss:dark.css
sass themes:public/css

⚖️ Ruby Sass CLI vs Dart Sass CLI

TopicRuby Sass (legacy)Dart Sass (prefer)
MaintenanceEnd of lifeActively maintained
Stdin default syntaxIndentedSCSS
Force other syntax--scss--indented
--stylenested, expanded, compact, compressedexpanded, compressed
Style short flag-t-s
Source maps--sourcemap=auto|file|inline|none--no-source-map, URL/embed flags
Ruby-only--require, --compassN/A — use JS/API or packages

⚙️ Important Legacy Options

OptionWhat it did
--style / -tnested (default), expanded, compact, compressed
--watchStay open; recompile on change
--updateEnable many-to-many / compile outdated files
--force / -fAlways rewrite CSS (not with --watch)
--load-path / -IExtra import paths (+ SASS_PATH env)
--sourcemapauto / file / inline / none
--scssParse stdin as SCSS
--interactive / -iSassScript REPL
--check / -cSyntax check only (not many-to-many)
--debug-info / -gLegacy debug media queries (prefer source maps)

🚀 Migrate to Dart Sass

  1. Install Dart Sass (Installation).
  2. Replace gem install sass / Bundler sass gem with the Dart sass CLI or npm package.
  3. Update scripts: map --style=compressed as before; drop nested/compact or switch to expanded.
  4. For stdin SCSS, you usually do not need a flag (Dart default); use --indented only for indented input.
  5. Retest builds; fix any language differences and prefer @use over legacy @import.

⚡ Quick Reference

Legacy Ruby commandModern Dart-oriented equivalent
sass in.scss out.csssass in.scss out.css (same idea)
sass themes:csssass themes:css
sass --watch themes:csssass --watch themes:css
sass --style=compressed …sass --style=compressed …
sass --style=nested …Use expanded (or omit; Dart default)
echo "…" | sass --scssecho "…" | sass --stdin
sass --sourcemap=none …sass --no-source-map …

Examples Gallery

Reference examples from the official Ruby Sass CLI docs. Do not install Ruby Sass for new work—compare with Dart Sass after you migrate.

📚 Legacy Commands

How old scripts typically invoked the Ruby sass gem.

Example 1 — One-to-One Compile

Compile a single SCSS file to CSS (or print to the terminal).

styles.scss
h1 {
  font-size: 40px;
}
terminal
sass style.scss style.css
sass style.scss          # print CSS to the terminal

How It Works

Same mental model as Dart Sass one-to-one mode. Today, run the equivalent with the Dart Sass CLI.

Example 2 — Many-to-Many Directory Compile

Official-style status lines when writing several CSS files.

terminal
sass themes:public/css
#      write public/css/light.css
#      write public/css/light.css.map
#      write public/css/dark.css
#      write public/css/dark.css.map

How It Works

Colon pairs and folder maps carried into Dart Sass. Drop Ruby-only habits like relying on indented stdin by default.

📈 Styles, Stdin & Watch

Flags you will still see in old Makefiles and Capistrano tasks.

Example 3 — Four Output Styles

Ruby Sass supported nested, expanded, compact, and compressed.

terminal
sass --style=nested style.scss
sass --style=expanded style.scss
sass --style=compact style.scss
sass --style=compressed style.scss

How It Works

On Dart Sass, keep expanded / compressed only. Replace nested or compact with expanded (or omit the flag).

Example 4 — Force SCSS on Stdin

Because Ruby defaulted stdin to indented syntax, SCSS pipes needed --scss.

terminal
echo "h1 {font-size: 40px}" | sass --scss

How It Works

Dart Sass: echo "h1 {font-size: 40px}" | sass --stdin (SCSS by default). Use --indented only when piping indented syntax.

Example 5 — Watch Mode

Stay open and rewrite CSS when themes change.

terminal
sass --watch themes:public/css
#      write public/css/light.css
#      write public/css/light.css.map
# After editing themes/dark.scss...
#      write public/css/dark.css
#      write public/css/dark.css.map

sass --watch --poll themes:public/css   # remote drives
sass --update style.scss                # many-to-many without colon

How It Works

Watch/update survived into Dart Sass with familiar flags. Drop Ruby-only extras (--compass, --require) during migration.

🚀 When This Page Still Helps

  • Reading legacy CI — decode old sass --style=compact scripts.
  • Migrating Rails / Compass apps — replace gem + --compass setups.
  • Interview / history — know why Ruby Sass existed and why it stopped.
  • Flag translation — map --sourcemap=none--no-source-map.
  • Teaching — contrast EOL tools with the maintained Dart Sass CLI.

🧠 Legacy Compile Flow (Historical)

1

Install gem

Ruby + sass gem (do not do this for new apps).

Legacy
2

Invoke sass

One-to-one paths or colon / watch many-to-many.

CLI
3

Apply styles & maps

nested/expanded/compact/compressed + --sourcemap.

Options
4

Migrate

Move the same workflow to Dart Sass and retest.

⚠️ Common Pitfalls

  • Installing Ruby Sass “just to learn” — learn Dart Sass instead.
  • Assuming stdin is SCSS — Ruby defaulted to indented; Dart defaults to SCSS.
  • Copying nested/compact — not available on Dart Sass.
  • Keeping --compass forever — replace with modern packages / CSS.
  • Mixing docs — Ruby flag letters differ (-t style vs Dart -s).

💡 Best Practices

✅ Do

  • Treat Ruby Sass as historical / migration reference
  • Move CI and local scripts to the Dart Sass CLI
  • Translate old styles to expanded or compressed
  • Document the migration in the repo README
  • Retest visual output after switching compilers

❌ Don’t

  • Start new projects on the Ruby gem
  • Depend on unmaintained Compass + Ruby Sass stacks
  • Ignore official EOL warnings on sass-lang.com
  • Assume every Ruby flag exists on Dart Sass
  • Leave production builds on an abandoned toolchain

Key Takeaways

Knowledge Unlocked

Five things to remember about the Ruby Sass CLI

EOL tool—understand it, then move to Dart Sass.

5
Core concepts
📄 02

Same modes

1:1 & many

CLI
⚙️ 03

4 styles

Dart keeps 2

Output
📝 04

Stdin

indented default

Quirk
05

Migrate

→ Dart Sass

Action

❓ Frequently Asked Questions

No. Official docs: Ruby Sass has reached end of life and is totally unmaintained. Switch to Dart Sass as soon as you can.
The sass executable from the Ruby gem. It compiled .scss/.sass to CSS in one-to-one or many-to-many mode, similar in spirit to today’s Dart Sass CLI.
By extension: .scss → SCSS, .sass → indented. Stdin and unknown extensions defaulted to the indented syntax unless you passed --scss.
Four: nested (default), expanded, compact, and compressed. Dart Sass keeps expanded and compressed only.
Install Dart Sass, replace ruby sass commands with the Dart Sass CLI (often similar), update npm/CI scripts, and retest. Prefer SCSS and modern @use modules.
Only enough to read old scripts. Invest learning time in the Dart Sass CLI and current Sass language features.
Did you know?

Official Ruby Sass docs still document --debug-info, which emitted dummy @media queries for line mapping—and warn that source maps are the modern replacement. Dart Sass focuses on source maps instead.

Conclusion

The Ruby Sass CLI shaped how teams compiled Sass for years, but it is end-of-life. Learn its modes and flags only to migrate—then standardize on the Dart Sass CLI for every new project.

Continue with Dart Sass CLI or Sass Variables.

Next: Sass Variables

With a modern CLI in place, learn $names, scope, and !default.

Sass Variables →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful