Share
How to Install a Specific Version of a Ruby Gem

August 10, 2023
2 minutes
Share
Interests
Posted in these interests:

gem install
command.
Use `gem install -v`
You may already be familiar withgem install
, but if you add the -v
flag, you can specify the version of the gem to install.
Using -v
you can specify an exact version or use version comparators.
Install a specific version
gem install mypackage -v 1.0.0
Install a gem using version comparators
gem install mypackage -v '>= 1.0.0'
# or
gem install mypackage -v '~> 1.0.0'