โ Ruby Programming learning pathRuby Programming ยท Module 9 of 10
Gems and Bundler
Gems are Ruby libraries; Bundler manages them per project.
๐ Key ideas
- gem install name installs a library globally.
- A Gemfile lists the gems a project needs.
- bundle install installs them and writes Gemfile.lock.
- Gemfile.lock pins exact versions so every machine matches.
- rubygems.org hosts the public gems.
๐ก Real-life example: Like a shopping list for a recipe: the Gemfile lists ingredients, and the lock file records the exact brands you bought.
GemA packaged Ruby library
GemfileList of a project's gems
Gemfile.lockExact installed versions
BundlerTool that installs gems from the Gemfile