Skip to content

Comments

Fix Heroku build failure caused by commonmarker on Ruby 4.0#3117

Merged
sankichi92 merged 2 commits intomainfrom
codex/fix-heroku-commonmarker-build
Feb 22, 2026
Merged

Fix Heroku build failure caused by commonmarker on Ruby 4.0#3117
sankichi92 merged 2 commits intomainfrom
codex/fix-heroku-commonmarker-build

Conversation

@sankichi92
Copy link
Owner

背景・経緯

Ruby 4.0.0 への更新後、Heroku デプロイ時に commonmarker のネイティブ拡張ビルドが走り、libclang 不足によりビルドが失敗していました。

ビルドログでは commonmarker が Rust/bindgen 経由で libclang.so を探索し、解決できずに Gem::Ext::BuildError となっていました。Heroku の標準ビルド環境ではこの依存を前提にできないため、Markdown レンダラをネイティブ依存のない構成に切り替えています。

変更内容

  • Gemfile
    • commonmarker を削除
    • kramdown を追加
  • Gemfile.lock
    • commonmarker および関連する rb_sys 系依存を削除
    • kramdown 依存を追加
  • app/controllers/docs_controller.rb
    • Commonmarker.to_html から Kramdown::Document.new(...).to_html へ変更

期待される効果

  • Heroku ビルド時に commonmarker のネイティブ拡張ビルドが発生しなくなり、今回の libclang 起因エラーを回避できます。

@sankichi92 sankichi92 merged commit 68efe0b into main Feb 22, 2026
8 checks passed
@sankichi92 sankichi92 deleted the codex/fix-heroku-commonmarker-build branch February 22, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant