What is RubyGems?
RubyGems is a package manager for the Ruby language. It provides a command-line tool called gem for installing and managing packages.
It enables you to create reusable Ruby code and distribute it through libraries, commonly known as gems, each with a specified version.
Other applications can utilize these libraries and versions by installing and downloading the packages.
If you wish to remove a library from your project, you can uninstall it using its name.
In the event of any changes to a library, a new version is released. Users have the option to update or download a specific or the latest version.
What is RubyGems used for?
Some of the supported features are:
Dependency Management: Each application has dependencies installed using the gem command. Alternatively, you can specify all dependencies in the Gemfile. This file contains versions and libraries required to run a project. With the gem command-line tool, you can easily install, uninstall, and upgrade package versions. It also handles transitive dependencies (dependencies with other dependencies) with specific versions.
Repository Management: By default, gems are published to the RubyGems repository with versions. Library users can download the latest version from the repository. You can configure the repository location to a GitHub repo or any other accessible location via HTTP or HTTPS link.
Installation: Installing RubyGems is straightforward and supported on all platforms. In a project, dependencies are easily manageable with a single command, allowing you to install, uninstall, upgrade, and list packages.
Ruby Community: Ruby provides community support with a wide range of libraries (gems) managed by the community. Publishers upload their code for sharing, and users can easily download and install it into their projects.
Check if the RubyGem is installed or not
You can check rubygem is installed using the gem --version
option in the terminal
E:\>gem --version
It gives gem version along with ruby version.