How to set Ruby's load path externally

后端 未结 4 538
我在风中等你
我在风中等你 2020-12-08 01:02

I have a custom Ruby library directory that I\'d like to have automatically added to Ruby\'s load path whenever Ruby is executed. I know I can use the -I optio

4条回答
  •  一整个雨季
    2020-12-08 01:21

    See the "Ruby and Its World" chapter from The Pickaxe Book, specifically the section on environment variables. Excerpt:

    RUBYLIB 
      Additional search path for Ruby programs ($SAFE must be 0).
    DLN_LIBRARY_PATH
      Search path for dynamically loaded modules.
    RUBYLIB_PREFIX
      (Windows only) Mangle the RUBYLIB search path by adding this
      prefix to each component.
    

提交回复
热议问题