What does the RAILS_GEM_VERSION setting do?

What is the purpose of installation RAILS_GEM_VERSIONin config/environment.rb? Is the application supposed to stop working under an unexpected version of Rails?

I just upgrade Rails to the latest version on my laptop and in production. So how do I do this, can I comment RAILS_GEM_VERSIONor do I need to install it for some reason?

+5
source share
1 answer

Since you can have more than one version of Rails installed on your system (you can check it using the gems list rails), your application should know which version it should use. It will not be very smart to “keep Rails updated to the latest version” and allow the application to use the latest version, because since the new version of Rails can break it very easily (each new version means some API changes). However, this constant does not matter if you “freeze” the version of Rails for which your application was created in the supplier’s folder. Btw. Rails freezing is good practice, as your application is then more independent of the environment.

+5
source

All Articles