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 P2.0, released 2 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.

Key: Typo Tech. Error Suggestion Not a problem Next edition

By default this page displays the errata for the latest version of the book. If you have a previous version, select it here:  

(To find out what version you have, look at the copyright page, a few pages in from the front of the book. If it says (say) 'Second Printing', then here it'll be P2.0. If there are interim PDF releases in that printing, they'll be 2.1, 2.2, and so on.)

PDF Paper Description Found in Fixed in
TOC

#38958: The page numbers in the Table of contents, index, etc. are 1 too small--David C. Toll

P2.0
22-Apr-09
All

#38976: The page numbers in cross references are 1 below what they should be.--David C. Toll

P2.0
23-Apr-09
56

#39256: Some text was cut away, last text was: " have an exact internal representation. When we "
--Sebastian Rydberg

P2.0
27-May-09
57
#39217: Assignment method is: def price_in_cents=(cents) @price = cents / 100 end Shouldn't the middle line be: @price = Float(cents) / 1...more...
P2.0
18-May-09
131
#39096: "subsubtring" where "substring" should be used: "You’ll sometimes want to match a pattern only if the matched subsubtring is preceded by or fo...more...
P2.0
04-May-09
133
#39097: Either the word "refer" or the word "count" should be removed from this sentence: "Negative backreference numbers refer count backward from t...more...
P2.0
04-May-09
198

#39522: The second paragraph has 'expectations' misspelled twice: "expections" in the second line and "expecations" in the fourth line.--Octav Popescu

P1.0
17-Jun-09
270
#39001: Apparently, there was a mixup between ∂ (U+2202) and δ (U+3B4). All examples are given with δ but the codepoints are those of ∂. Thus there ar...more...
Dave Thomas says: It's just the way TeX prints the character.
P2.0
25-Apr-09
271
#39554: The paragraph under 'Interactive Configuration' says: "For example to change your prompt back to DEFAULT you could use the following:" but the...more...
P1.0
19-Jun-09
337
#39436: The description for first form of 'case' expressions says: "case when condition ..." while the description for "if" and other similar expressi...more...
P1.0
13-Jun-09
337
#39185: I can not reproduce the behavior of class variable as described on pages 337 and 338 of Programming Ruby 1.9. Here is a file with Ruby code...more...
P2.0
12-May-09
337
#39186: With respect to erratum #39185, I tried the same code on an older Ruby build: $ ruby -v 1.9.0 (2006-06-08) [x86_64-linux] With this ver...more...
P2.0
12-May-09
339
#39435: The second paragraph for section "break, redo, next, and retry" says: "retry restarts the loop, reevaluating the condition." However on page 1...more...
P1.0
13-Jun-09
341
#39292: Description of $stdout states: "Assignment to $stdout is not permitted: use $stdout.reopen instead." I believe this is not exact. STDOUT ca...more...
P2.0
31-May-09
341

#39293: $> states: "The default value is $stdout." it should be STDOUT, not $stdout. Also it would be helpful if it was noted that $> and $stdout are aliases.--Marc-Andre Lafortune

P2.0
31-May-09
349
#39443: First paragraph says: "... A module may contain class and instance methods and may define constants and class variables. As with classes, modu...more...
P1.0
14-Jun-09
353
#39444: First paragraph for 'Calling a Proc' says: "You can call a proc by invoking its methods call, yield, or []. The three forms are identical." No...more...
P1.0
14-Jun-09
353
#39445: Second paragraph for 'Calling a Proc' says: "You can also invoke a proc using the syntax name.(args...). This is mapped internally into a.call...more...
P1.0
14-Jun-09
355

#39446: Second line in first paragraph has "exceptioons".--Octav Popescu

P1.0
14-Jun-09
367

#39645: Top of page: "exceptioons" should be "exceptions".--Kenneth Ballou

P2.0
25-Jun-09
396
#39478: Last paragraph says: "Previously, constants were looked up in the lexical scope in which there were referenced." It should be "...they were re...more...
P1.0
16-Jun-09
399
#39479: First paragraph ends with "Because of this, most people are moving away from this style of CFinstance_evaled block." Not clear what 'CF' stand...more...
P1.0
16-Jun-09
438

#39605: Second paragraph, third line: "tha" should be "the" ("the safe level of the code that invoked tha [sic] proc").--Kenneth Ballou

P2.0
22-Jun-09
448
#38973: In the specification of the instance methods for class Array, on pages 448 on, it uses "enum" for each array reference (the same as is used la...more...
P2.0
23-Apr-09
452

#38984: In Array#cycle, the following should be removed:
"Equivalent to enum.to_a.cycle. See Array#cycle"
since... we _are_ at Array#cycle!--Marc-Andre Lafortune

P2.0
24-Apr-09
454

#39089: Array#find_index returns an enumerator if no block and no argument is given--Marc-Andre Lafortune

P2.0
04-May-09
455

#38985: Interface of Array#frozen: "frozen?!".gsub("!","")--Marc-Andre Lafortune

P2.0
24-Apr-09
487
#39360: The first section of the Enumerator description says: "Some of the methods in the Enumerable module can return an Enumerator object" But t...more...
P1.0
07-Jun-09
488

#38983: Enumerable#detect should have a "1.9" symbol next to it, since it can now be called without a block--Marc-Andre Lafortune

P2.0
24-Apr-09
489

#39088: Enumerable#find_index can also be given a single argument (as shown in Array#find_index)--Marc-Andre Lafortune

P2.0
04-May-09
493

#39156: "that is, any? will return true..." should read "that is, one? will return true..."--Geoff Jacobsen

P2.0
09-May-09
496

#39003: I believe the syntax Enumerator.new{ some block } is new to Ruby 1.9 and thus should have a "1.9" symbol next to it.--Marc-Andre Lafortune

P2.0
25-Apr-09
498

#39098: Enumerator#next is 1.9 only, so there should be a "1.9" symbol next to it.--Marc-Andre Lafortune

P2.0
04-May-09
533
#39188: Hash.[] has two other forms. The second and third form take a single argument which is either an array of key-value pairs or an object convert...more...
P2.0
12-May-09
535

#38990: Missing ")" in interface after "hsh.assoc( key"--Marc-Andre Lafortune

P2.0
24-Apr-09
537

#38860: Hash#delete_if: interface probably shouldn't have the ⟨ ⟩ around the block. Same with Hash#reject!--Marc-Andre Lafortune

P2.0
13-Apr-09
540

#38859: Interface of Hash#rassoc missing the closing parenthesis.--Marc-Andre Lafortune

P2.0
13-Apr-09
542

#38974: The specification of the method "to_hash" says "see page 375. I think this should be page 378.--David C. Toll

P2.0
23-Apr-09
559

#38959: For "readbyte", it says "Returns the next 8-byte byte". I suspect this should be "8-bit byte".--David C. Toll

P2.0
22-Apr-09
568

#38967: This line looks a bit sketchy:
Available only with the
-n or -p command-line options are present.

--Cornelius Reiber

Dave Thomas says: It should say "only *if*", not "only *with*")
P2.0
23-Apr-09
574
#39146: #39013: The bottom of the page describing Marshal is cut off.--Dave Thomas 1, Erratum noted above references page 584, should be 574 (a...more...
P2.0
07-May-09
584

#39013: The bottom of the page describing Marshal is cut off.--Dave Thomas

P2.0
26-Apr-09
591

#39049: Method#arity refers to Method#parameters. AFAIK, such a method does not exist (yet).--Marc-Andre Lafortune

P2.0
01-May-09
613

#39548: The header for class Object shows it has not superclass. However in Ruby 1.9 it has BasicObject as superclass.--Octav Popescu

P1.0
18-Jun-09
621

#39022: In Ruby 1.9, retuns an enumerator if no block is given.--Marc-Andre Lafortune

P2.0
28-Apr-09
621
#39050: Oups, sorry, I meant to say Numeric#step returns an enumerator if no block is given (in Ruby 1.9), so the interface should change, and a "1.9"...more...
P2.0
01-May-09
622

#38982: obj =~ other_obj
→ !(obj=~ other_obj)

should be

obj !~ other_obj
→ !(obj=~ other_obj)--Marc-Andre Lafortune

P2.0
24-Apr-09
631

#39016: Missing closing parenthesis after + in Object#to_enum interface--Marc-Andre Lafortune

P2.0
26-Apr-09
681

#38911: Interface of String#gsub has second and third form on the same line--Marc-Andre Lafortune

P2.0
17-Apr-09
688
#38965: The first line of the description of slice! starts "Deletes the specified portion from strand....." There is a space missing between "str" ...more...
P2.0
22-Apr-09
688

#38975: In the specification of slice!, it says that "this is a string".slice!(3..6) returns " is ". When I try it I get "s is".

--David C. Toll

Dave Thomas says: The previous line removes the 'i', so all the characters have shifted down.
P2.0
23-Apr-09
695

#39002: String#upto has a second optional argument.--Marc-Andre Lafortune

P2.0
25-Apr-09
699
#39135: The 'members' instance method of Struct returns an array of symbols rather than strings, and this is a change in 1.9. members joe.members →...more...
P2.0
07-May-09
754

#38871: First line of text: "generator-lke" should be "generator-like"--Kim Shrier

P2.0
14-Apr-09
807

#39053: "It's" should not have an apostrophe in "the module uses it’s random_bytes method"--Andrew Grimm

P2.0
01-May-09
879
#38856: According to the previous page, you should require 'socket' in order to use this BasicSocket class. But, the heading at the top of the library...more...
P2.0
13-Apr-09