Challenge - 5 Problems
Bundler Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this Bundler command?
You run
bundle list in a Ruby project with a Gemfile containing gem 'rack', '~> 2.2'. What will Bundler display?Ruby
bundle list
Attempts:
2 left
💡 Hint
Think about what
bundle list shows after gems are installed.✗ Incorrect
bundle list shows the gems installed in the current bundle with their versions. Since rack version 2.2.3 satisfies '~> 2.2', it will be listed.
🧠 Conceptual
intermediate1:30remaining
What does the
Gemfile.lock file do?In a Ruby project using Bundler, what is the main purpose of the
Gemfile.lock file?Attempts:
2 left
💡 Hint
Think about how Bundler ensures everyone uses the same gem versions.
✗ Incorrect
Gemfile.lock locks the gem versions resolved during bundle install so that all developers and deployments use the exact same versions, avoiding conflicts.
🔧 Debug
advanced2:30remaining
Why does this Bundler install fail?
You run
What is the cause?
bundle install but get this error:Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (~> 6.1.0)
Another dependency requires rails (~> 7.0)What is the cause?
Attempts:
2 left
💡 Hint
Look at the version requirements in the error message.
✗ Incorrect
The error shows a version conflict: the Gemfile wants rails ~> 6.1.0 but another dependency requires rails ~> 7.0, so Bundler cannot resolve a compatible version.
📝 Syntax
advanced2:00remaining
Which Gemfile syntax is correct for specifying a source and a gem with a version constraint?
Choose the correct Gemfile syntax to specify RubyGems.org as the source and include the gem 'nokogiri' version '~> 1.12'.
Attempts:
2 left
💡 Hint
Gemfile uses Ruby DSL syntax, not hash or method calls.
✗ Incorrect
The correct syntax uses source 'url' and gem 'name', 'version' without colons or parentheses.
🚀 Application
expert3:00remaining
How to update a single gem without changing others?
You want to update only the 'puma' gem to the latest compatible version without updating other gems in your bundle. Which Bundler command should you use?
Attempts:
2 left
💡 Hint
Check Bundler's command to update specific gems.
✗ Incorrect
bundle update puma updates only the 'puma' gem and its dependencies, leaving other gems locked to their current versions.