DEV Community

Discussion on: Rails 6 & Webpacker Settings for Production

mtancoigne profile image
Manuel Tancoigne • Edited on

sometimes you get inconsistent yarn.lock file, because your systems are different.

To avoid this, I have the same Node and Ruby version on the server and on the dev computers:

  • Node Version Manager (nvm), or N are great to have multiple node versions in userland (not system wide). With a .node-version file in the project and Automatic Version Switching (avn), the proper node version is used when you cd to your project.
  • RBEnv works the same for Ruby, with a .ruby-version file in the project.

It may be a burden to setup, but once it's done, it's done, and changing projects and required versions becomes a breeze.

Example of contents for the .xxx-version files

  • .ruby-version should be the exact version, as far as I remember:
    • 2.5.1
    • 2.6.6
  • .node-version has any level; avn will pick what matches:
    • 12
    • 10.2
    • 10.6.5
tcgumus profile image
Tuna Çağlar Gümüş Author

thank you for your comment. I will try that :)