Home Interests Ruby

How to Install a Specific Version of a Ruby Gem

howchoo
howchoo   (467)
August 10, 2023
2 minutes

Share

Interests
Posted in these interests:
ruby • 1 guides

Installing gems is easy enough, but how do you install a specific version? Or a range of versions? In this guide, we’ll cover the basics of RubyGem’s gem install command.

Use `gem install -v`

You may already be familiar with gem 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'

howchoo

 467 guides

Introducing Howchoo, an enigmatic author whose unique pen name reflects their boundless curiosity and limitless creativity. Mysterious and multifaceted, Howchoo has emerged as a captivating storyteller, leaving readers mesmerized by the uncharted realms they craft with their words. With an insatiable appetite for knowledge and a love for exploration, Howchoo's writing transcends conventional genres, blurring the lines between fantasy, science fiction, and the surreal. Their narratives are a kaleidoscope of ideas, weaving together intricate plots, unforgettable characters, and thought-provoking themes that challenge the boundaries of imagination.

Discover interesting things!

Explore Howchoo's most popular interests.

Explore