よしだです

プログラミングの勉強してます

gemfile.lockがcommitされてなくてherokuにデプロイできなかった話

普通にherokuにデプロイしようとしたら

       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
       You are trying to install in deployment mode after changing
       your Gemfile. Run `bundle install` elsewhere and add the
       updated Gemfile.lock to version control.
       You have added to the Gemfile:
       * pg

とかいうエラーが出て怒られた。

 

ググってみるとgemfileとgemfile.lockが不整合になっていると起こるエラーらしいので、改めてコミットし直したら解決しました。

 

なんでgemfile.lockだけコミットできてなかったんだろうなあ

bundle installやる前にコミットしてたってことなんだろうけど、無意識っていやですねえ