what is “$:” in ruby?

前端 未结 3 1802
清酒与你
清酒与你 2021-02-07 06:31

Usually be seen in .gemspec file. eg. i18n.gemspec.

$: << File.expand_path(\'../lib\', __FILE__)
3条回答
  •  离开以前
    2021-02-07 06:58

    $: is equivalent to $LOAD_PATH, i.e. the list of directories that you can require files from without giving a more specific path. You'll find the Ruby QuickRef useful for other predefined variables you may run into.

提交回复
热议问题