Sass Ruby Sass CLI

Beginner
10 min read
Updated: Nov 2026
5 examples
Legacy / EOL

Definition and Usage

The Ruby Sass CLI was the original sass executable from the Ruby gem. It compiled .scss / .sass to CSS in one-to-one or many-to-many mode — the ancestor of today’s Dart Sass CLI.

Use this page only to read legacy scripts or plan a migration. Do not install Ruby Sass for new projects.

End of life.

Official Sass docs: Ruby Sass has reached end of life and is totally unmaintained. Switch to Dart Sass at your earliest convenience.

Why keep this page?

Old Makefiles, Capistrano tasks, and READMEs still show Ruby flags (--style=nested, --scss, --compass). Knowing the mapping speeds migration.

Stdin default differed.

Ruby Sass defaulted stdin / unknown extensions to the indented syntax. Dart Sass defaults to SCSS. That alone breaks many piped one-liners.

Syntax (Legacy)

terminal
# One-to-one
sass style.scss style.css
sass style.scss          # print CSS to the terminal

# Many-to-many
sass style.scss:style.css
sass themes:public/css

# Common legacy flags
sass --style=nested style.scss
sass --watch themes:public/css
echo "h1 {font-size: 40px}" | sass --scss

Pattern for migration: translate the same paths to the Dart Sass CLI, then drop Ruby-only flags.

vs Dart Sass

Key differences when reading old commands:

TopicRuby Sass (legacy)Dart Sass (prefer)
StatusEnd of life / unmaintainedCurrent implementation
Stdin defaultIndented syntaxSCSS (--indented if needed)
Force SCSS on stdin--scssDefault / --stdin
--stylenested, expanded, compact, compressedexpanded, compressed only
Style short flag-t-s
Source maps--sourcemap=auto|file|inline|noneOn by default; --no-source-map, embed flags
Ruby-only--require, --compass, cache flagsNot available — remove or replace
ModulesPrimarily @import era@use / @forward

Legacy CLI Examples

Reference samples from the official Ruby Sass CLI docs. Do not install Ruby Sass for new work — compare each output with the Dart Sass equivalent.

Example 1 — One-to-One Compile

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

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

How It Works

  1. Same mental model as Dart Sass one-to-one mode.
  2. Omit output to print CSS to the terminal.
  3. Commands look identical for this simple case.
  4. Run them with Dart Sass after you uninstall the Ruby gem.

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

  1. Colon pairs / folders enable many-to-many mode.
  2. Partials starting with _ skip CSS output.
  3. Update semantics rewrite only outdated files.
  4. Same folder map works on Dart Sass today.

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

  1. Default was nested (indent to match Sass nesting).
  2. Dart Sass dropped nested and compact.
  3. Map those two to expanded (or omit the flag).
  4. Keep compressed for production builds.

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

  1. Ruby stdin defaulted to indented Sass.
  2. --scss was required for brace syntax pipes.
  3. Dart Sass defaults to SCSS — drop --scss.
  4. 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

  1. --watch enables many-to-many and stays open.
  2. --poll helps on remote / network drives.
  3. --update forces many-to-many without colons.
  4. Flags survived into Dart Sass — drop Compass / require gems.

Edge Cases & Pitfalls

Most migration bugs are stdin defaults, removed styles, or Ruby-only gems.

eol

Do not install for new apps

Ruby Sass will not receive fixes. Start on Dart Sass from day one.

stdin

Flip the stdin assumption

Ruby = indented by default. Dart = SCSS by default. Rewrite pipes carefully.

style

nested / compact are gone

CI scripts using those values must switch to expanded or compressed.

gems

Drop --compass and --require

Replace Compass mixins with modern CSS or Dart Sass modules / npm packages.

Sass Support

Ruby Sass is historical documentation only. Prefer Dart Sass for every new compile.

ImplementationStatus
Ruby Sass CLIEnd of life — unmaintained
Dart Sass CLICurrent — use this
LibSass / node-sassDeprecated — migrate to Dart Sass
BrowsersN/A — only receive compiled CSS

Last familiar Ruby Sass line many people saw: Sass 3.7.x. Check sass --version after switching so you are not still on the gem.

Key Takeaways

  • EOL: Ruby Sass is unmaintained — migrate to Dart Sass.
  • Modes look familiar (one-to-one / many-to-many / watch).
  • Watch stdin & styles — those defaults changed.
  • Learn Dart Sass for new work; use this page only as a map.

One line: treat Ruby Sass CLI docs as a migration dictionary — then live on Dart Sass.

Migrate Notes

Practical checklist when leaving the Ruby gem:

migrate.txt
1. Install Dart Sass (npm / Homebrew / binary)
2. Confirm `sass --version` is Dart Sass, not 3.7.x
3. Replace nested/compact → expanded (or omit)
4. Drop --scss on SCSS pipes; add --indented only if needed
5. Remove --compass / --require; replace with modern deps
6. Prefer @use over @import; retest CI & watch scripts

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.

Next: Sass Variables

Leave the legacy CLI behind and start writing modern SCSS.

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.

8 people found this page helpful