# Is there an online reference for dollar ($) variables?

**URL:** <https://www.ruby-forum.com/t/is-there-an-online-reference-for-dollar-variables/113523>\
**Category:** Ruby\
**Created:** [September 1, 2007, 4:23am UTC](https://www.ruby-forum.com/t/is-there-an-online-reference-for-dollar-variables/113523 "2007-09-01T04:23:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lfast](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ee59a6/32.png) [@lfast](https://www.ruby-forum.com/u/lfast)\
**Post date:** [September 1, 2007, 4:23am UTC](https://www.ruby-forum.com/t/is-there-an-online-reference-for-dollar-variables/113523/1 "2007-09-01T04:23:59Z")

</div>

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).

Thanks,  
Larry

---

<div class="post-metadata">

**Author:** ![lfast](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ee59a6/32.png) [@lfast](https://www.ruby-forum.com/u/lfast)\
**Post date:** [September 1, 2007, 6:02am UTC](https://www.ruby-forum.com/t/is-there-an-online-reference-for-dollar-variables/113523/2 "2007-09-01T06:02:08Z")

</div>

On 9/1/07, Larry F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ## Thanks, Larry
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

I hate to break it you, but probably you are looking for :

> **[Ruby | zenspider.com | by ryan davis](https://www.zenspider.com/ruby/)**
>
> Ruby facts, opinions, source code, links, and stuff.

ahoy zenspider… 🙂

–  
Let them talk of their oriental summer climes of everlasting  
conservatories; give me the privilege of making my own summer with my  
own coals.

[http://blog.gnufied.org](http://blog.gnufied.org)

---

<div class="post-metadata">

**Author:** ![lfast](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ee59a6/32.png) [@lfast](https://www.ruby-forum.com/u/lfast)\
**Post date:** [September 1, 2007, 6:06am UTC](https://www.ruby-forum.com/t/is-there-an-online-reference-for-dollar-variables/113523/3 "2007-09-01T06:06:09Z")

</div>

> something like
> 
> ## Thanks, Larry
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

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/](http://www.rubycentral.com/book/), though that seems currently down for  
maintenance.

HTH,

Felix

---

<div class="post-metadata">

**Author:** ![lfast](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ee59a6/32.png) [@lfast](https://www.ruby-forum.com/u/lfast)\
**Post date:** [September 1, 2007, 7:17am UTC](https://www.ruby-forum.com/t/is-there-an-online-reference-for-dollar-variables/113523/4 "2007-09-01T07:17:13Z")

</div>

On Aug 31, 8:24 pm, Larry F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 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?

[http://phrogz.net/ProgrammingRuby/language.html#predefinedvariables](http://phrogz.net/ProgrammingRuby/language.html#predefinedvariables)

---

<div class="post-metadata">

**Author:** ![lfast](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ee59a6/32.png) [@lfast](https://www.ruby-forum.com/u/lfast)\
**Post date:** [September 1, 2007, 12:52pm UTC](https://www.ruby-forum.com/t/is-there-an-online-reference-for-dollar-variables/113523/5 "2007-09-01T12:52:41Z")

</div>

Le samedi 01 septembre 2007 04:24, Larry F. a Ã©critÂ :

> Thanks,  
> Larry

You also may take a look at the ‘English’ library, from the stdlib  
([RDoc Documentation](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  
their  
meanings.

eg :  
$! → $ERROR\_INFO  
$@ → $ERROR\_POSITION  
$\_ → $LAST\_READ\_LINE

---

<div class="post-metadata">

**Author:** ![lfast](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ee59a6/32.png) [@lfast](https://www.ruby-forum.com/u/lfast)\
**Post date:** [September 2, 2007, 5:44am UTC](https://www.ruby-forum.com/t/is-there-an-online-reference-for-dollar-variables/113523/6 "2007-09-02T05:44:48Z")

</div>

Thank you all. Those are great references that I added to our local  
Wiki. Here are some diagnostics on the links:

Ruby Central was inaccessible when I tried it, 8:30 PDT Saturday.

[Ruby.org](http://Ruby.org)’s copy of the Pragmantic Programmer’s Guide is different  
(older?) than phrogz.

This link:  
[http://phrogz.net/ProgrammingRuby/language.html#predefinedvariables](http://phrogz.net/ProgrammingRuby/language.html#predefinedvariables)  
takes me to the right page but the #… didn’t work.

English looks great but it seems to be missing $: and probably a few  
other internal variables.

Again, thank you all very much.  
Larry F.

---

<div class="post-metadata">

**Author:** ![lfast](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ee59a6/32.png) [@lfast](https://www.ruby-forum.com/u/lfast)\
**Post date:** [September 2, 2007, 2:46pm UTC](https://www.ruby-forum.com/t/is-there-an-online-reference-for-dollar-variables/113523/7 "2007-09-02T14:46:01Z")

</div>

Le dimanche 02 septembre 2007 05:44, Larry F. a Ã©critÂ :

> takes me to the right page but the #… didn’t work.
> 
> English looks great but it seems to be missing $: and probably a few  
> other internal variables.
> 
> Again, thank you all very much.  
> Larry F.

English doesn’t define a name for $: because there’s already an alias  
for this  
one, in the core ruby : $LOAD\_PATH

---

<div class="post-metadata">

**Author:** ![lfast](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ee59a6/32.png) [@lfast](https://www.ruby-forum.com/u/lfast)\
**Post date:** [September 2, 2007, 4:41pm UTC](https://www.ruby-forum.com/t/is-there-an-online-reference-for-dollar-variables/113523/8 "2007-09-02T16:41:14Z")

</div>

On Sep 1, 9:44 pm, Larry F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [Ruby.org](http://Ruby.org)’s copy of the Pragmantic Programmer’s Guide is different  
> (older?) than phrogz.

I did a lot of custom markup and CSS from the source code (awesomely)  
offered up for free by the original authors, but I think the source  
file is likely the same.

> This link:[The Ruby Language](http://phrogz.net/ProgrammingRuby/language.html#predefinedvariables)  
> takes me to the right page but the #… didn’t work.

Can’t imagine why. What OS/browser/version? That page validates as  
correct HTML 4.01 Transitional, and there is 1 and only 1 element on  
that page with the ID “predefinedvariables”.

The sub-page anchor works for me in both Safari and Firefox on the Mac.

---

<div class="post-metadata">

**Author:** ![lfast](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ee59a6/32.png) [@lfast](https://www.ruby-forum.com/u/lfast)\
**Post date:** [September 2, 2007, 6:09pm UTC](https://www.ruby-forum.com/t/is-there-an-online-reference-for-dollar-variables/113523/9 "2007-09-02T18:09:03Z")

</div>

Gavin K. wrote:

> Larry F. wrote:
> 
> > [Ruby.org](http://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)  
Expressions  
Method Definition  
Class Definition  
Module Definition  
Access Control  
Blocks, Closures & Procs  
Exceptions  
—end of page—  
Next link goes to Classes and Objects - same as the other copies

> > This link:[The Ruby Language](http://phrogz.net/ProgrammingRuby/language.html#predefinedvariables)  
> > takes me to the right page but the #… didn’t work.  
> > I went back and it worked this time. Must have been Gremlins :-o

Thanks for mentioning $LOAD\_PATH, Olivier. Googling it turned up  
multiple hits but none in any ‘standard’ Ruby sites. Searching on  
[ruby-lang.org](http://ruby-lang.org) came up blank as well. Like sooo many things it’s  
community knowledge.

Thank you again,  
Larry
