1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Ruby】json を 3.0.0 にしたら cairo が死んだ

1
Last updated at Posted at 2026-09-08

Ruby で,cairo というグラフィックライブラリーがある。
これを使ったプロジェクトで,bundle update したら起動すらしなくなった。

cairo のロード時に Bundler::GemRequireError が発生して死ぬ。

原因

  • json が2026年9月7日付で 3.0.0 になった
    • このとき,JSON.loadcreate_additions オプションが廃止された
    • 安全性に問題があったとのこと
  • cairo gem は色情報を扱う red-colors という gem に依存している
  • red-colors gem(バージョン 0.4.0) は create_additions使っている

解決

本件は既に red-colors にプルリクエストが提出されている:
fix: change JSON.load to JSON.parse to make code work with json v3 - #30
ただ,red-colors は最後のリリースから二年半が経ち,古い issues や pull requests が溜まったままになっているので,修正版がすぐにリリースされるかは分からない。

さしあたり json をバージョン 3 未満で使うことになりそう。

追記 2026-09-09

件のプルリクエストはすぐに取り込まれ,無事 red-colors 0.5.0 がリリースされた。
本件は解決した。関係者のみなさまに感謝。

……のだが,本記事を書くきっかけになった Rails アプリ(cairo を使っている)で,bundle update したら直ったかというと,今度は active_decorator と json 3.0.x の絡みで Internal Server Error が出た。
やれやれ。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?