How to Switch Between Ruby Versions of Gem

Asked 2 years ago, Updated 2 years ago, 415 views

The Ruby version I want to deal with is old and
Installing Gem individually.

when a Gem dependency is installed. Existing Gems may overlap.

Toggle while leaving both duplicated Gems I want to do it. Please teach me.

ruby-on-rails ruby

2022-09-30 21:55

1 Answers


for switching between installed versions of Gem gem(gem_name,*version_requirements)->bool.

For example, the latest version is usually called

require "csv"

pCSV::VERSION#=>"3.1.9"

If you specify a version before require,

require "rubygems"
gem "csv", "3.1.7"
require "csv"

pCSV::VERSION#=>"3.1.7"

will be


2022-09-30 21:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.