What does the “$” character mean in Ruby?

前端 未结 5 1635
深忆病人
深忆病人 2020-12-08 01:40

Been playing with Ruby on Rails for awhile and decided to take a look through the actual source. Grabbed the repo from GitHub and started looking around. Came across some co

5条回答
  •  一整个雨季
    2020-12-08 02:39

    $: is the global variable used for looking up external files.

    From http://www.zenspider.com/Languages/Ruby/QuickRef.html#18

    $: Load path for scripts and binary modules by load or require.

提交回复
热议问题