2

export RUBYLIB=<path>/gem/lib为了使用我对本地机器上的 Ruby gem 所做的调整,我已经使用过。我不明白它实际上改变了什么。我有一个脚本可以打开一些终端选项卡,如果我想使用调整后的 gem,我必须事先这样做。

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

4

1 回答 1

2

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.bashrcor ~/.bashrc

于 2013-06-25T15:12:37.107 回答