Gem

Noun · Development

Definitions

  1. A packaged Ruby library or command-line application distributed through RubyGems, Ruby's package manager, which has been bundled with Ruby since version 1.9. Each gem is described by a gemspec file declaring its name, version, authors, files, and dependencies, and is installed with gem install from the public registry at rubygems.org or a private source. Some gems include native extensions written in C that compile at install time, which is the usual cause of installation failures on machines missing build tools. In applications, dependencies are managed by Bundler: the Gemfile states which gems are wanted and with what version constraints, and Gemfile.lock records the exact versions resolved so every environment installs the same set. Gems are versioned by semantic versioning convention, and the pessimistic operator ~> is the idiomatic way to accept compatible updates while refusing breaking ones.

    In plain English: A pre-built Ruby library you can install with one command — like an app from an app store, but for your Ruby project.

    Example: "Just add the gem to your Gemfile, run bundle install, and you've got authentication handled."

Related Terms