💎 Ruby on Rails
Beginner
What is a Gemfile and Bundler in Rails?
Answer
The Gemfile is a file in the root of a Rails project that declares all Ruby gem dependencies and their version constraints. Bundler is the dependency manager that reads the Gemfile, resolves compatible versions, and installs them. Run bundle install to install gems. Gemfile.lock records the exact resolved versions to ensure all developers and production servers use the same gem versions. Use bundle exec rails ... to run commands in the context of the bundled gems, avoiding version conflicts.