How to require a user-installed ruby ​​gem when a system-wide gem with a higher version is also available?

I have two versions of the installed gem: system-wide 1.3.2, and custom 1.0.0.

I need to use only the version 1.0.0that is installed in my dir house. Is there any way to say gemto prefer user-installed gems?

+4
source share
2 answers

You can specify which version of gem to use with the command gembefore you use it require.

gem 'foo', '1.0.0'
require 'foo'
+3
source
+2

Source: https://habr.com/ru/post/1527286/


All Articles