Errata for Programming Ruby 1.9 (3rd edition)
We try to keep our books accurate, but sometimes mistakes creep in. This page lists the errors submitted by our astute readers. If you've found a new error, please submit it.
The latest version of the book is P5.0, released 7 months ago. If you've bought a PDF of the book and would like to upgrade it to this version (for free), visit your home page.
| Paper | Description | Found in | Fixed in | |
|---|---|---|---|---|
| 9 |
#50957: Website for RVM lists old one: beginrescueend.com instead of new one rvm.io--David Acevedo |
P5.0
05-Mar-13 |
||
| 20 |
#49454: The example for accept_loop has nothing to do with accept_loop and is, in fact, the same as the example for getaddrinfo--Greg Stearns |
P4.1
23-Jun-12 |
||
| 26 |
#49455: Note: this erratum is only for the Socket Library appendix, though the report link directs here.
the ipv6only! method is misspelled in diff...more...
|
P4.1
23-Jun-12 |
||
| 50 |
#50346: The use of the exclusive range operator had me thinking there was a typo/off-by-one error. After messing with it in irb, I understand how it w...more...
|
P5.0
08-Dec-12 |
||
| 60 |
#50607: In general the path:"samples" is wrong, dont exist in the zip file.
In this case: samples/book_in_stock.rb the correct path is: code/tut_cl...more...
Dave Thomas says: I don't see this in my edition
|
P5.0
29-Jan-13 |
||
| 83 |
#49728: third last line should be
|
P4.2
23-Aug-12 |
||
| 99 |
#51340: show_regexp(a, /[\d\-]/) # => see [The PickAxe->-<-page 123]
Actually this returns "no match" because the regex is looking for a digit foll...more...
|
P5.0
19-Apr-13 |
||
| 145 |
#49955: In the first example of 10.4 catch and throw (bottom of page), you have; puts result.reverse Should that not be; puts result.sort.reverse--Mike Cook Dave Thomas says: I think it is OK—it prints the words in the reverse order to that in which they were added. |
P5.0
18-Oct-12 |
||
| 154 |
#49960: 11.5 Parsing HTML
The Hpricot GEM is no longer maintained (github.com/hpricot), perhaps this section should be updated to use an alternativ...more...
|
P5.0
19-Oct-12 |
||
| 157 |
#50172: In the "Creating Ruby Threads" section, the first example iterates over the "page" variable when it should uses "pages" as defined earlier.--Joseph Crail |
P5.0
16-Nov-12 |
||
| 163 |
#50469: The hypothetical currency converter example, the ensure clause must be inside a begin... end.
begin
puts(exchange_rates.convert(line))
...more...
Dave Thomas says: It's OK as it stands—method bodies are automatically exception handlers.
|
P5.0
16-Jan-13 |
||
| 224 |
#49921: test in book is:
context "specifying words and a dictionary" do
should "return the words" do
opts = Anagram::Options.new(["-d", "mydict",...more...
Dave Thomas says: I believe it is correct as it stands
|
P4.2
05-Oct-12 |
||
| 232 |
#50244: In the parenthetical sentence about half-way down the page, remove the comma from "another, significant use".--Joseph Crail |
P5.0
03-Dec-12 |
||
| 308 |
#49596: Please follow the discussion here: bugs.ruby-lang.org/issues/6810 to see how it turns out. For me, this is a rather fundamental change in how...more...
|
P4.2
29-Jul-12 |
||
| 350 |
#50243: In the first line of the last paragraph, change "practic" to "practice".--Joseph Crail |
P5.0
03-Dec-12 |
||
| 370 |
#49640: I do not get the expected output ("Dave lives in Texas and likes Programming Languages") for the example in the page.
1.9.3p194 :005 > clas...more...
Dave Thomas says: Looks like you already had a Person class defined
|
P4.2
11-Aug-12 |
||
| 529 |
#49964: Under the documentation for IO.binwrite, it says:
"options is an optional hash used to pass parameters to the underlying open call used by ...more...
|
P5.0
19-Oct-12 |
||
| 545 |
#49967: IO#set_encoding takes an options argument for specifying encoding behavior.--Brian Ford |
P5.0
21-Oct-12 |
||
| 562 |
#50760: IO#gets describes behaviour for a negative limit argument that MRI does not adhere to and is not mentioned in online rubydoc or tested in rubyspec--Grant Gardner Dave Thomas says: I believe however that the book is correct: rb_io_getline_1(VALUE rs, long limit, VALUE io) { VALUE str = Qnil; rb_io_t *fptr; int nolimit = 0; rb_encoding *enc; GetOpenFile(io, fptr); rb_io_check_char_readable(fptr); if (NIL_P(rs) && limit < 0) { str = read_all(fptr, 0, Qnil); if (RSTRING_LEN(str) == 0) return Qnil; } else if (limit == 0) { return rb_enc_str_new(0, 0, io_read_encoding(fptr)); } else if (rs == rb_default_rs && limit < 0 && !NEED_READCONV(fptr) && rb_enc_asciicompat(enc = io_read_encoding(fptr))) { NEED_NEWLINE_DECORATOR_ON_READ_CHECK(fptr); return rb_io_getline_fast(fptr, enc, io); } |
P5.0
07-Feb-13 |
||
| 742 |
#50379: In the description for Time.local, the text reads: "The second form accepts ten arguments . . ." The ten argument form is actually the first ...more...
|
P4.
14-Dec-12 |
||
| 811 |
#49757: The index entry for %{...} takes me to 298 but it should take me to the table on page 296.
I have a hard time using the book as a reference...more...
Dave Thomas says: It takes you to 298 because that is the specific use of %{...}
|
P4.2
29-Aug-12 |
||
| 818 |
#51241: The order of the modules in the Standard Library chapter in P4.0 goes OpenSSL (pg 815), OptionParser (pgs 816-817), OpenStruct (pg 818). I'm ...more...
|
P4.
05-Apr-13 |
||
| 833 |
#50842: Index entry for "return" has "The ii tag should not be here." Looks like an error from the index generator. --Dave Liebreich |
P5.0
20-Feb-13 |

