Reputation: 1000
I have two versions of a gem installed: system-wide 1.3.2
,
and user-installed 1.0.0
.
I need to use only version 1.0.0
, which is installed in my home
dir. Is there a way to tell gem
to prefer user-installed gems?
Upvotes: 4
Views: 229
Reputation: 13690
You can specify which gem version to use by using the gem
command before you require
it.
gem 'foo', '1.0.0'
require 'foo'
Upvotes: 3
Reputation: 16507
You can specify the GEM_PATH variable, pointing to the gem version 2, GEM_HOME to path to gems for the selected ruby interpreter, and specify PATH to binary folder at the beginning of all PATHs, which contains the gem version.
Use rvm, or rbenv apps to control ruby/gem apps per project.
Upvotes: 2