Home > Software design >  Can't write to lockfile while frozen Ruby on Rails
Can't write to lockfile while frozen Ruby on Rails

Time:10-06

Hello I'm trying to run the following commands to prep my Rails app for production:

bundle lock --add-platform ruby

bundle lock --add-platform x86_64-linux

Then I get this error:

Cannot write a changed lockfile while frozen.

What is going on here? What is the lockfile for? What does it mean to be frozen?

CodePudding user response:

What is the lockfile for?

The presence of a Gemfile.lock in a .. repository ensures that a fresh checkout of the repository uses the exact same set of dependencies every time. https://bundler.io/v2.2/guides/faq.html

What does it mean to be frozen?

--frozen Do not allow the Gemfile.lock to be updated after this install. Exits non-zero if there are going to be changes to the Gemfile.lock. https://bundler.io/v2.2/man/bundle-install.1.html

This probably doesn't apply to you yet, but in Bundler 3, --deployment will imply --frozen.

CodePudding user response:

Running the following command allowed me to write to my lock file

bundle config unset deployment   
  • Related