Skip to content

[rails] /ruby/internal/anyargs_h_270_1)" is not a valid Ident

Published: at 03:51 PM (1 min read)

這幾天在裝 rails 的環境時,安裝 tiktoken_ruby 時遇到了 compile error

20: rb_sys_build::bindings::generate
    21: build_script_main::main
    22: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
make: *** [target/release/libtiktoken_ruby.dylib] Error 101

make failed, exit code 2

嘗試後發現在 arm 架構的 mac 上,應該要多設定 bundle compatibility with the arm64-darwin-21 platform

bundle lock --add-platform arm64-darwin

執行完後重新 bundle install 即可 🎉

參考資料: