Is there an online reference that describes all the Ruby $… variables?
Are there any search engines that allow you to search for something like
$: ? Is there anything in the Rdocs?
Personally, I’m very happy with the list of $… variables found in the
2nd edition of Ruby P.ming. However a few of my colleagues do not
have a copy of this book. While I try to avoid using them there are
times when it’s almost unavoidable. For example, I haven’t found any way
to append new directories to the Load Path $: within my Ruby code
(specifically my Rakefile).
The first version includes them, and is available online (and even as a
package for local installation in some distros). I believe the location
is http://www.rubycentral.com/book/, though that seems currently down for
You also may take a look at the ‘English’ library, from the stdlib
(http://ruby-doc.org/stdlib/). It gives explicit names to the predefined
global variables. At the same time, it’s a good resource for describing
Ruby.org’s copy of Pragmantic Programmer is different (older?) than phrogz.
…but I think the source file is likely the same.
Hmmm. On the Language page in particular, phrogz version is very
different. The ruby-doc and ruby-central versions seem to be the same.
The Language page stops after:
Variables and Constants
Scope of Variables and Constants
—end of page—
Next link goes to Classes and Objects
But in phrogz version Variables and Constants appears at the 1/3 mark on
the page. Also the index interface is completely different. Phrogz
copy goes on to list
Predefined Variables (the very next section)
Blocks, Closures & Procs
—end of page—
Next link goes to Classes and Objects - same as the other copies
Thanks for mentioning $LOAD_PATH, Olivier. Googling it turned up
multiple hits but none in any ‘standard’ Ruby sites. Searching on ruby-lang.org came up blank as well. Like sooo many things it’s
Thank you again,
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.