s4na's blog

s4naのテックブログ

ファーストペンギン

sass-railsを使っていて"Ruby Sass has reached end-of-life and should no longer be used."とエラーが表示されたら

sass-railsを使うと表示されるエラーメッセージ

Ruby Sass has reached end-of-life and should no longer be used.

* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
  primary implementation: https://sass-lang.com/install

* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
  sassc gem: https://github.com/sass/sassc-ruby#readme

* For more details, please refer to the Sass blog:
  https://sass-lang.com/blog/posts/7828841

エラーの意味

どうやらsassというGemに寿命が来てしまったらしいです。
sassじゃなくてsasscを使えば良いと書いてありました。

とはいえsassを使っているのはsass-rails。僕じゃどうしようもないのかな?🤔

sass-lang.com

と思って調べていたところ、sass-rails側で対応されていました。 github.com

github.com

対処方法

ということで、Gemfileでsass-railsのバージョンを6以降にしましょう。

# Gemfile
gem "sass-rails", "~> 6"

さいごに

エラーメッセージに書いてある

https://sass-lang.com/blog/posts/7828841 にアクセスしてみてもNot foundが返ってきてしまいますね。

たぶん https://sass-lang.com/blog/ruby-sass-is-unsupported だと思うんですけど、

GitHubリポジトリがread-onlyになっているので、PRも投げられなさそう?🤔

github.com