我已使用export RUBYLIB=<path>/gem/lib来对本地计算机上的Ruby gem进行调整。我不了解它实际发生了什么变化。我有一个打开一些终端标签的脚本,如果我想使用调整后的 gem ,我必须事先这样做。

我可以只做一次export RUBYLIB=<path>/gem/lib,而不必再次做一次吗?它实际上是做什么的?

最佳答案

ruby-doc

RUBYLIB - Additional search path for Ruby programs ($SAFE must be 0).

The list of paths mentioned here will be added to the list of paths Ruby uses to search for libraries included in the program with the require method. The paths in RUBYLIB will be searched before other directories

要一次性完成,请将export RUBYLIB=/gem/lib附加到/etc/bash.bashrc~/.bashrc

10-04 19:10