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?

More than 3 years have passed since last update.

railsサーバー起動時のnokogiriエラーの解決策

Last updated at Posted at 2022-04-14

概要

rails s起動時にnokogiriのライブラリのエラーとなりました。
その解決策の備忘です。

確認環境

M1 Mac上でdocker起動

エラー内容

/usr/local/bundle/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in `require’: cannot load such file -- nokogiri/nokogiri (LoadError)

解決策

bundle installする前に以下コマンドを実行
bundle config set force_ruby_platform true

おわり

M1 Macが原因と思われた(根拠なし)。
bundle install時のログがこんな感じだったのが気になったので試してみたらうまくいきました!

Using nokogiri 1.13.3 (aarch64-linux)

参考

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?