Unfortunately no book is perfect, and that includes Eloquent Ruby. But together we can make it more perfect. If you find a mistake, leave a comment or write to me at russ@russolsen.com and I’ll include it here.
Here are the mistakes that were found in the 1st printing which have been corrected in the 2nd:
Page xxii: The word just before the bulleted list should be “issues” (plural) [Russ Olsen]
Page xxvi: Actually Steve Ingram helped with chapter 6 [Russ Olsen]
Page 78: Jane Austen’s name is misspelled in the code example. [Aaron Massey]
Page 143: The word “the” is missing just after the first example. The end of the sentence should read “… are both references to identically the same objects” [Russ Olsen]
Page 146: In the second line of the second example, there is an extra space before the .new and a missing space after the [Russ Olsen]
Page 173: The names of the classes in the first paragraph are mixed up. The beginning of this sentence should read “Again, no problem. When Ruby is confronted with @@default_font = :nimbus, it will look at the Presentation class (nope), and then at Document (no again), and so on, and eventually decide to attach @@default_font to the Presentation class. Since there are two @@default_fonts, one on the Resume class and one on the Presentation class…” [Sonia Hamilton]
Page 233: The references to block_supplied? should actually be block_given? [John G. Norman]
Page 328: The > in the class statement of the second example should be a < [Peter Cooper, although he pointed out the error without actually saying which page!]
Page 278: In second paragraph, the last bit of code should be plural: instructions.content. [Bodo Tasche]
Page 299: The references to block_supplied? should actually be block_given? [John G. Norman]
And the corrections found after the 2nd printing:
Page 33: The range in the for
loop at the bottom of the page
should be the exclusive flavor, with three
dots: 0...words.size
. [Marly Wilson]
Page 38: Towards the top of the page, it should say that hashes have usually “been an unruly bunch.” [Dave Shapiro]
Pages 39-40: Given that the characters mentioned are all from the
Marvel universe, the XML file should probably be called
marvel.xml
, not dc.xml
. [Ryan Alexander]
Page 46: At the end of the third line “doubled-quoted” should (obviously) be “double-quoted.” [Jim Shapiro]
Page 46: The string in the first bit of code should say that the time is now… [Jim Shapiro]
Page 59: The sentence in about the middle of the page should read: “Second, the zero is telling us that when…” [amos]
Page 78: The eval method is not actually defined in the Object class, but rather in the Kernel module, which gets included by Object. [Mathias Lafeldt]
Page 111: The mention of before(:any) should actually be before(:each) [Mathias Lafeldt]
Page 185: The second sentence after the section heading should read: “As we will see in Chapter 24, nothing in ruby is ever really done.” [amos]
Page 204: The Busy in ErrorCode::Busy should be in all caps: ErrorCode::BUSY. [Aaron Massey]
Page 237: The code blocks in the second example take only a single parameter (doc) while the save and load methods actually call the blocks with two parameters (self and path). While syntactically correct, this is confusing. The code in the second example probably should include both parameters. [Brand]
Page 302: The string in the middle example on the page should (obviously) be ‘Hitch Hikers Guide To The Galaxy By Douglas Adams’ [Vadim]
Page 318: The content method at the bottom of the page would be much better if it had used join rather than inject. [James Gray]
Page 339: There is an @ missing from the before method. The body of the method should read “@before_action = block”. [mega]
Page 375: There is a spelling mistake in footnote nine. It should begin “Historically, most gems were hosted…” [Owain McGuire]
Thanks to everyone who has written in with corrections!