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 P3.0, released 9 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
90
#47044: info = @data_source.send("get_#{name}_info", args[0]) price = @data_source.send("get_#{name}_price", args[0]) => info = @data_...more...
P1.0
11-May-11
94

#47084: require 'using' fails
maybe require_relative '../blocks/using' is needed to be used.--Maulin Pathare

P3.0
19-May-11
96
#48358: At the beginning of section 3.7, the boss writes a `test_events.rb` file that includes two events, both of which get triggered. The example wo...more...
P2.0
18-Dec-11
98

#48357: "Your main code loads the files that end with `event.rb`".

This should be "(...) that end with `events.rb`" (plural events).--Katrina Owen

P2.0
18-Dec-11
98
#48359: "[setups and events are] evaluated in the context of an `Object` that acts as a _Clean Room_". It would be very helpful if the example on p...more...
P2.0
18-Dec-11
131

#47241: The book says that you can use Class#new to define a new class. This is not correct, you use Class.new.

P1.0
01-Jul-11
146

#47299: class D < C; end

absent in the code snippet.--Selman ULUG

P3.0
21-Jul-11
158

#47071: broken_math.rb sample code is missing the following line.

require 'test/unit'
--Yasuo Honda

P2.0
16-May-11
203
#47107: module.rb sample does not work. -- $ rails -v Rails 2.3.2 $ ruby -v ruby 1.9.2p180 (2011-02-18) [i686-linux] $ ruby modules.rb /usr/loc...more...
P3.0
24-May-11
224

#48348: "They also call model objects to execute business logics,"

"logics" should be "logic"

P3.0
18-Dec-11
234

#48349: Footnote is not numbered and not referenced on the page.

P3.0
18-Dec-11

Stuff To Be Considered in the Next Edition

PDF Paper Description Found in Fixed in
1
#45084: From Kado: a comment about "private" on the book: there is one exception: it's "setter" method. "setter" always need "self" as literal. ...more...
P2.0
17-Sep-10
1

#46235: One reader complained that the ToC is useless. Any ways to make it more informative?--Paolo Perrotta

P2.0
14-Jan-11
1
#48047: (from @jonclaus) The methods/dynamic_definition.rb code example in Chapter 5 didn't convey define_method's power or a reason to use it over th...more...
P3.0
26-Nov-11
1
#47041: Rewrite the Methods chapter to talk about the trade-offs of Ghost Methods vs. Dynamic Methods. Show the two main Ghost Method spells (the "dif...more...
P2.0
10-May-11
41

#44209: It might be useful to discuss the way that Dynamic Dispatch relates to Second-order predicates in mathematical logic.--Rich Morin

P1.0
21-Jul-10
47
#46467: "Note that define_method() is executed inside the definition of Computer..." As the author noted, that should be: "Note that define_comp...more...
Paolo Perrotta says: It might be worth it to streamline the example as you suggest, but I still like the "inside definition" approach of the example. I'll think harder about this in a possible next edition. Thanks!
P1.0
24-Feb-11
56
#41959: Hi Paola, I am learning a lot from the book! Great content! A suggestion for the "The Top Level" sidebar: I would extend this a bit to mention...more...
B1.5
31-Dec-09
98
#43087: The 'lambda.call' solution does not seem to clear the setups and events variables for each new events file, whereas the previous solution on p...more...
Paolo Perrotta says: I think that the lambda example gets its point across (you can have a shared local scope in lambda), even if it's not isofunctional to the previous example. However, you're right that this difference in behavior should be stressed. At this point I'd rather reconsider the entire example, though - piling up more notes and distinctions on it would just make it more confusing. I'll save your (very good) suggestion for the next edition of the book.
P1.0
04-May-10
120
#41771: The test cases for the redflag example are too simple to preclude a number of more simplistic solutions to the problem. In particular there's...more...
B1.5
10-Dec-09
123
#42023: I like your example answer ( blocks/monitor_framework/redflag.rb ) but I see some issues ... I'm sorry if I'm wrong in my assumptions. - Th...more...
Paolo Perrotta says: Jeff, your assumptions are definitely valid. See erratum #43087 - if I ever write a second edition of the book, I'll reconsider the entire example. At the current stage, I'd rather keep it as it is, with dark corners and everything, than pile up more notes on it.
B1.5
08-Jan-10
126
#45413: In the GUT, rule 6 needs a little hint that the class of a class object will be class Class at the top of the eigenclass chain. Seeing figure...more...
Paolo Perrotta says: This would be best fixed by adding Class in figure 4.5. Re-doing a picture is a pretty big change, outside the scope of a reprint - so it'll have to wait until a second edition. Thank you for telling me.
P1.0
20-Oct-10
135
#44211: A third problem with the Around Alias is that it pollutes the name space and might clash with an existing or future name. Why not present t...more...
Paolo Perrotta says: Good point, Rich. This will come useful in the second edition.
P1.0
21-Jul-10
148
#47913: From pwim on Twitter: "4.5 Quiz: Module Trouble seems to fall outside of The Great Unified Theory. Is including modules not part of the object...more...
P3.0
07-Nov-11
149
#43256: The author suggests that you can't support methods that accept blocks, such as Array#find, with dynamic dispatch, and thus you'll need to reso...more...
Paolo Perrotta says: Thank you for your comments Tim. :) About the item you reported, I wasn't clear enough in the book. This example assumes that somebody is putting the method name, arguments and (eventually) the block on a web page. If you don't care about blocks, then your user can just insert the name of a method and the values of arguments - but if you want to also allow your user to input a block, then you can only capture the content of the block as a string. If you do that, then you have to use eval() to pass that string on to the Array method. A tad confusing in hindsight. I'll probably find a clearer way to express it in a next edition of the book.
P1.0
15-May-10
175
#42010: The text says, "It [erb] ... also creates a Clean Room (109) to execute the code in a separate scope." P. 109 shows how to create a clean roo...more...
B1.5
05-Jan-10
184
#43561: Similar to comment #41674, I'm confused about all this extra machinery. I don't see why module/mixin authors must go through such ridiculous c...more...
Paolo Perrotta says: The reason is that this is actually a common pattern in the wild - in particular, Rails usues it a lot. I'm not very enthusiastic about all of this complication either, and apparently neither are the Rails authors, because they changed it in Rails 3. However, the book heavily uses Rails 2 as an example in the second part, so it has to explain what's going on. I'll consider removing this description in a second edition of the book.
B1.5
05-Jun-10
243
#42849: Nill Guards do not work well with booleans. a = false # a gets initialized .... a ||= true # initialization gets overwritten Effecti...more...
Paolo Perrotta says: This would make a nice additional sidebar. I'll wait for this kind of large changes until the second edition of the book.
P1.0
20-Apr-10