Recall & Review
beginner
What is Bundler in Ruby?
Bundler is a tool that manages Ruby application dependencies. It ensures that the right gems and versions are installed and used for your project.
Click to reveal answer
beginner
What file does Bundler use to list dependencies?
Bundler uses a file named
Gemfile where you list all the gems your project needs.Click to reveal answer
beginner
What command do you run to install all gems listed in the Gemfile?
You run
bundle install. This installs all the gems and their correct versions specified in the Gemfile.Click to reveal answer
intermediate
What is the purpose of the
Gemfile.lock file?The
Gemfile.lock records the exact versions of gems installed. It helps keep dependencies consistent across different machines.Click to reveal answer
intermediate
How does Bundler help avoid 'dependency hell'?
Bundler locks gem versions and manages dependencies so different projects can use different versions without conflicts.
Click to reveal answer
Which file do you edit to add a new gem dependency in Bundler?
✗ Incorrect
The Gemfile is where you list your gem dependencies. Gemfile.lock records installed versions but is not edited manually.
What command updates gems to the latest versions allowed by the Gemfile?
✗ Incorrect
bundle update updates gems to the newest versions allowed by the Gemfile constraints.What does Bundler do if a required gem version conflicts with another gem?
✗ Incorrect
Bundler detects version conflicts and stops with an error to prevent broken dependencies.
Which command runs your Ruby program using the gems managed by Bundler?
✗ Incorrect
bundle exec runs commands using the gems specified in your Gemfile.lock.Why should you commit Gemfile.lock to version control?
✗ Incorrect
Committing Gemfile.lock ensures consistent gem versions across all environments.
Explain how Bundler manages gem dependencies in a Ruby project.
Think about how you list gems, install them, and keep versions consistent.
You got /5 concepts.
Describe the role of the Gemfile.lock file and why it is important.
Consider what happens if different machines use different gem versions.
You got /4 concepts.