How can I set the ruby loadpath?

How can I set the ruby loadpath outside of the source code? for example,
set up an environment variable or add a command-line parameter.

Zhao Yi wrote:

How can I set the ruby loadpath outside of the source code? for example,
set up an environment variable or add a command-line parameter.

ruby -h says:

-Idirectory specify $LOAD_PATH directory (may be used more than
once)

Zhao Yi wrote:

How can I set the ruby loadpath outside of the source code? for example,
set up an environment variable or add a command-line parameter.

On Windows you can set RUBYLIB env variable.