これは何
- ruby on railsのチュートリアルでherokuへアプリケーションをデプロイする場面があるのですが、以下のようなエラーで先に進めませんでした
remote: -----> Installing dependencies using bundler 2.2.21
remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote: Your bundle only supports platforms ["x86_64-darwin-19"] but your local platform
remote: is x86_64-linux. Add the current platform to the lockfile with `bundle lock
remote: --add-platform x86_64-linux` and try again.
remote: Bundler Output: Your bundle only supports platforms ["x86_64-darwin-19"] but your local platform
remote: is x86_64-linux. Add the current platform to the lockfile with `bundle lock
remote: --add-platform x86_64-linux` and try again.
remote:
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
- エラーメッセージにある
bundle lock --add-platform x86_64-linux
を試しても解決できず - 同様のエラーをぐぐるとbundlerのバージョン下げるべしとの記事も多数見つかるのですが、私の場合解決できませんでした。
どう解決した
- Gemfile.lockのPLATFORMSにrubyを足す
PLATFORMS
roby
x86_64-darwin-19
x86_64-linux
-
すいません理屈はわかりませんわかったら追記します
-
以下のissueを参考にしました
-
チュートリアルやってて同様の箇所でつまづいた人の助けになりますよう