Ruby 3.2に同梱されるBundlerでは、 bundle gem に --ext=rust とすることでrustでgemのコードを書けるようになります。 新しいものはとりあえず触ってみたいので、試してみましょう(完全にn番煎じなのですが、自分用の備忘録です) 事前準備 rustのビルド環境 Ruby 3.2.0(正確にはBubdler 2.4.0以上) やってみる rust_gem_sample という名前のライブラリを作ってみるとしましょう。 $ bundle gem rust_gem_sample --ext=rust : # 場合によってはさまざまな質問があるので適当に答える これで雛形ができる。 作成された rust_gem_sample ディレクトリへ移動し、コードをさらっと眺めてみましょう。 rustのコードはC言語の場合と同じように ext ディレクトリ内に生成される。