SirRupertIII
SirRupertIII

Reputation: 12596

What does "export RUBYLIB=<path>/gem/lib" do?

I've used export RUBYLIB=<path>/gem/lib in order to use the adjustments I made to a Ruby gem on my local machine. I don't understand what it actually changes. I have a script that opens up a few terminal tabs and if I want to use the adjusted gem I have to do this beforehand.

Can I just do export RUBYLIB=<path>/gem/lib once and not have to do it again? And what does it actually do?

Upvotes: 2

Views: 1245

Answers (1)

VoidPointer
VoidPointer

Reputation: 3097

From ruby-doc,

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

ie, 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.

To make it as one time effort, append export RUBYLIB=/gem/lib to /etc/bash.bashrc or ~/.bashrc.

Upvotes: 3

Related Questions