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 B1.6, 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
all
#35399: A common requirement that clients have is the ability to create URLs with hyphens rather than underscores (i.e., good looking and SEO optimize...more...
B1.6
22-Oct-08
.com
#36056: hxxp://www.pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition --- release dates says March 15, 2008. I think you mean...more...
B1.6
22-Nov-08
ALL
#35550: It would be great to see a section on the symbols used in rails with a description of what each is used for rather than an example. e.g. => ...more...
B1.6
30-Oct-08
18
#35173: .. such as AJAX and RESTful inter faces into their code: support is built in. (And if you’re not familar with AJAX and REST inter faces, n...more...
B1.6
12-Oct-08
30
#35323: I would expect much more Hyperlinks in a book which is deliviered electronically (PDF). (Dave says: all cross references within the PDF, an...more...
B1.6
18-Oct-08
31
#35487: Last paragraph on the page: "The most common templating scheme, called ERb embeds snippets ..." should be "The most common templating...more...
B1.6
27-Oct-08
33
#35251: I think you really should mention heroku.com as a way to develop an application without having to install everything. It's invaluable for lea...more...
B1.6
14-Oct-08
36
#35013: Doesn't this command work for all operating systems, not just Mac OS X? When would this step be necessary? Couldn't one just do rake db:mig...more...
B1.6
07-Oct-08
36
#35014: Instead of saying 10.4 and 10.5, and then latter referring to Tiger and Leopard, but not telling the reader that 10.4 is Tiger, and 10.5 is Le...more...
B1.6
07-Oct-08
36
#35015: Instead of saying 10.4 and 10.5, and then latter referring to Tiger and Leopard, but not telling the reader that 10.4 is Tiger, and 10.5 is Le...more...
B1.6
07-Oct-08
37
#36136: In the installation of Linux (Ubuntu 8.10 here).. The -y apparently isn't needed any longer for the line: sudo gem install -y rails ...more...
B1.6
26-Nov-08
37
#35953: The current version of ubuntu does not seem to have a working copy of gems. I get strange error messages when I try to update. Just download...more...
B1.6
17-Nov-08
38
#35488: In the penultimate paragraph, in the sentence, "It’s a simple way to ensure that accidential breakages get immediate attention." "accident...more...
B1.6
27-Oct-08
38
#35016: Was: How to change the version of Rails that your application is using is described in the sidebar on page 246. To: How to change the v...more...
B1.6
07-Oct-08
38
#35017: Since there are multiple authors, does it make sense to say I write my Rails programs using a programmer’s editor wiihout identifying wh...more...
B1.6
07-Oct-08
41
#35489: Footnote 5 makes no sense. It says the same thing as the footnoted sentence. Both say to use the command "gem server". Either this command ...more...
B1.6
27-Oct-08
41

#35018: To view the Rails API documentation, open the location

doc/api/index.html ( or rails_apps/demmy_app/doc/api/index.html)

with a browser.--Jim Oser

B1.6
07-Oct-08
43
#34809: Reference/link "Postgres hxxp://ruby.scripting.ca/postgres/" is incorrect. Link is broken (yields 404 page; looks like domain wasn't renewed a...more...
B1.6
04-Oct-08
44
#35952: In Ubuntu 8.04 (Hardy) the gems directory is not part of the path. In 8.04, gems are located in /var/lib/gems/1.8/bin Just add that your path...more...
B1.6
17-Nov-08
48
#32023: I also got the above - When I run it: "Routing Error No route matches "/say/hello" with {:method=>:get}" I had to restart mongrel to get th...more...
B1.1
16-May-08
50
#36112: When I edited the comntroller to add the say action and saved the file then refereshed my webpage I got an error 'unable to find the path' I k...more...
B1.6
25-Nov-08
50
#34642: The demo example doesn`t work, since there is no database table! Okay, i did not exactly follow the guide... i am using Aptana... but this mi...more...
B1.6
26-Sep-08
52
#35931: In your whirlwind intro to ERb, the one thing that is missing is the comment syntax, <%# %> . Any programmer is going to want to add comment...more...
B1.6
16-Nov-08
52
#35298: Say hello demo does not work. There is no route to the resource hello as it is not one of the standard REST actions. I get the following er...more...
B1.6
16-Oct-08
54
#36109: After <% 3.times do -%> Ho!<br /> <% end %> Merry Christmas! The output isn't: Ho!<br /> Ho!<br /> Ho!<br /> Merry Christmas ...more...
B1.6
24-Nov-08
54

#34574: The word 'whitespace' is improperly hyphenated and broken across lines 4-5 as 'whites-pace'.--John Goetz

B1.5
20-Sep-08
54
#34807: On the Second paragraph on the first line there is the sentence: "Normally, this doesn't matter, because HTML..." The end of the line is en...more...
B1.6
04-Oct-08
68
#35415: The paragraph is as follows: you can now skip forward to (((Section 6.1, Create the Products Database and Maintenance Application))), on pa...more...
B1.6
23-Oct-08
69
#35808: In the General Recovery Advice box the sentence 'then everything should work described.' would read better as 'then everything should work as ...more...
B1.6
11-Nov-08
69
#35043: "Typos happen to the best of us and side explorations are not only are possible, they are positively encouraged." Should read "side explorat...more...
B1.6
09-Oct-08
75
#33022: In the commandline examples: It is sometimes hard to distinguish what is to be typed and what is actually output from the commandline (especia...more...
B1.3
11-Jul-08
77
#35354: in the command at the top of the page, the '>' for the second line confuses windows folks; I included the '>' in the command and the scaffold ...more...
B1.6
19-Oct-08
77
#34436: In the first code listing on this page, it is difficult to distinguish between the user's command and the resulting output. Use of color and ...more...
B1.5
07-Sep-08
78
#35028: Page 69 states A few "magic" commands worth knowing, explained in detail later: rake db:sessions:clear and rake db:migrate VERSION=0. Pag...more...
B1.6
08-Oct-08
80
#36128: On my computer using the InstantRails install it does not give me a time stamp it just numbers the migrations 001 002 003. So the discussion a...more...
B1.6
25-Nov-08
80

#35372: Chapter 6, Footnote 10: "preceeding" should be "preceding".--Morris Keesan

B1.6
20-Oct-08
80
#35281: Code example typo: ....add when it adds columns to an existing table. depot> ruby script/generate migration add_price_to_product price:d...more...
B1.6
15-Oct-08
87

#31952: In the self.up method, the text "foundational piece of any project's" appears to be italic, which would be odd as this is part of the code listing.--Dave Roberts

B1.0
08-May-08
88
#35801: in the code for price_must_be_at_least_a_cent where it says price < 0.01 - it needs to be price.to_f < 0.01 because of error with comparing st...more...
B1.6
11-Nov-08
88

#34285: The footnote on this page flows over to the next page's footnotes.--Zach Langley

B1.5
28-Aug-08
89
#32577: The migration code contained this assignment to image_url: :image_url => '/images/svn.jpg' , when I run the example, the generated html ...more...
B1.3
01-Jul-08
89

#35917: The footnote on the bottom of page 89 is a carry over from page 88 and starting is mid thought which is confusing to the reader.--Dale Noll

B1.6
15-Nov-08
91
#35999: In the code listing for class AddTestData, there is a string delimited by %{ }. This string is not oblique like other strings in the code lis...more...
B1.6
19-Nov-08
91
#36089: delete 'scaffold' from the line <%= stylesheet_link_tag 'scaffold', 'depot' %> in the products.html.erb code snippet. Correct is <%= st...more...
B1.6
23-Nov-08
94
#35392: Text states that "we created a depot.css stylesheet" but all that was done on previous pages was to add a reference to the depot stylesheet on...more...
B1.6
22-Oct-08
96
#32420: after adding the storecontroller, i received an error "No route matches "/login/index" with {:method=>:get}". restarting mongrel cleared t...more...
B1.3
19-Jun-08
97

#35800: After creating the storecontroller you might want to mention for them to restart webrick so the updates for the new route get picked up. --jeff mikres

B1.6
11-Nov-08
98

#31916: The background colour of logo.png doesn't match the css colour of the header. In the screenshot it looks like it should. Trivial, I know :)--Antony Blakey

B1.0
07-May-08
98
#35001: Typesetting software is producing ligatures in the text - it's fine for the most part, but when I copy+pasted "find_products_for_sale" in the s...more...
B1.6
07-Oct-08
101

#34865: The styles shown in that page are not for the task 7.2 (Add a Page layout). I believe it's for the Cart layout.

--Steven Tan

B1.6
05-Oct-08
101
#34929: The stylesheet modifications at the end of section 7.2 don't have anything to do with the output of the main "store" page. All the needed styl...more...
B1.6
06-Oct-08
102
#34930: Minor point: The styling of the page is such that the price of the last entry in the catalog (Pragmatic Version Control) doesn't clear the pic...more...
B1.6
06-Oct-08
104
#35728: We're working away at putting a button on the page, then instructed to put an action in that won't work - "So, that’s what we will have to fix...more...
B1.6
09-Nov-08
104
#33976: The examples given for the number_to_currency helper method show corresponding example outputs. However, the chosen indicator, "=>", which di...more...
B1.4
13-Aug-08
107
#35788: the user will get very confused as items appear and disappear in their cart across requests. (I think it should be "users"; the plural, beca...more...
B1.6
11-Nov-08
108
#32678: After adding the cart and cookies to the application, I started getting "ActionController::InvalidAuthenticityToken" error messages whenever I...more...
B1.3
07-Jul-08
109
#35253: In application.rb we are told to add the following: session :session_key => '_depot_session_id' however in the environment.rb file creat...more...
B1.6
15-Oct-08
110
#31958: It's possible to get a rather hard to find error if you leave off the parenthesis on the else clause in add_product (@items << CartItem.new(pr...more...
B1.0
09-May-08
110
#31960: I got a 'uninitialized constant Cart::CartItem)' error, which took me quite a while to figure out. It was obviously a class loading problem, b...more...
B1.0
09-May-08
111
#34936: Since later in the book (p118) you are swapping the order the calls to find_cart and Product.find (lines 2 and 3 of store_controller.rb), it i...more...
B1.6
06-Oct-08
111

#32450: protect_from_forgery :only => [:create, :update, :destroy]

Should sort it. Books needs to mention this.--Adam Craven

B1.3
24-Jun-08
111
#35020: Possible error (I'm just learning)--my cart would not update and it would only add one item. I'd return to the store, add another and only the...more...
B1.6
08-Oct-08
113

#34935: Some explanation of this syntax would be helpful:

current_item = @items.find {|item| item.product == product}--Phil MacGovern

B1.6
06-Oct-08
116

#35395: Text states "exception at line 16"; however, a close look at your figure 8.2 on the next page indicates it is line 10.

--Bill Colvin

B1.6
22-Oct-08
116
#34934: "show her the result of our morning's work." - according to the story you are spinning, it is after lunch and you have made these changes in t...more...
B1.6
06-Oct-08
116
#34190: On pages 116-118, exceptions are said several (I noticed seven) times to be 'thrown' rather than 'raised'. Other languages use this terminolog...more...
B1.5
22-Aug-08
122
#34614: This may be a suggestion, who knows. During the example of adding the total price to the Depot cart the example image shows a formatted Total ...more...
B1.5
23-Sep-08
122
#34937: The method name of "redirect_to_index" is perhaps a little misleading; it doesn't take into account the flash. Perhaps call is "flash_and_redi...more...
B1.6
06-Oct-08
122
#35051: in "<% for cart_item in @cart.items %>" cart_item is different from the previously used "<% for item in @cart.items %>" It would avoid conf...more...
B1.6
09-Oct-08
123

#35114: The total price should be calculated like this:

def total_price
@items.sum { |item| item.price * item.quantity}
end
--Erik Bakke

B1.6
11-Oct-08
123

#34938: Inconsistent use of parentheses: <td><%= h(cart_item.title) %></td>

Never before had you used () with "h"--Phil MacGovern

B1.6
06-Oct-08
123
#35798: There is no error in total_price, but rather in our (the user's) code for CartItem.price; CartItem.price should return the cost of the item ti...more...
B1.6
11-Nov-08
130

#34221: end statement from previous code block has become separated by figure 9.1--Alan

B1.5
24-Aug-08
131
#33538: For reasons I can't understand at all, with Rails 2.1, my shopping cart in the sidebar was not getting refreshed until I *removed* the res...more...
B1.3
04-Aug-08
133
#36038: one more thing that can prevent the AJAX from working: when I saved add_to_cart.js.rjs in UTF-8/DOS mode (UltraEdit on Windows), it wouldn't w...more...
B1.6
21-Nov-08
136
#35161: <p>Having completed Iteration D3 everything works fine as long as there are already products in the cart. But if I empty the cart and add a bo...more...
B1.6
12-Oct-08
136
#36036: Just a heads up, using Aptana 1.2 the fade code doesn't seem to play nice. It works in IE 7 and Firefox 3.0.4 fine outside the IDE, but insid...more...
B1.6
20-Nov-08
140
#34624: The last sentence, in which you state that "making our application work regardless of whether JavaScript is enabled takes just a two line of c...more...
B1.6
24-Sep-08
142
#35198: hxxp://pragprog.wikidot.com/rails-play-time - doesn't contain reference/discussion for first bullet point in "Playtime" for Task D. [Yes I ...more...
B1.6
13-Oct-08
142

#34951: Line 7 - "Others finds it useful" should be "Others find it useful"
--Phil MacGovern

B1.6
07-Oct-08
145

#35037: The link to Tobias Lütke’s ActiveMerchant library is not correct. This seems to be better: www.activemerchant.org

B1.6
09-Oct-08
145

#35038: Payment module∗seems to be dead -> discussion seemst to indicate that people should use ActiveMerchant instead. Suggest to kill reference here.

B1.6
09-Oct-08
147
#34630: Hi, You have the following code snippets at the top of this page. <%= button_to "Checkout" , :action => :checkout %> <%= button_to "Empty ca...more...
B1.6
25-Sep-08
147

#34631: "Maybe we want to edit an existing model"

Should that read

"Maybe we want to edit an existing order"--James West

B1.6
25-Sep-08
147
#34673: "As it stands, that’s not particularly interesting: because it’s a new model, all the fields will be empty. However, consider the general case....more...
B1.6
29-Sep-08
151
#35841: The CSS breaks a bit here. Only inputs get the margin, and selects and text areas aren't inputs (for styling anyway). It should rightly be: ...more...
B1.6
12-Nov-08
152
#35238: In footnote 5, the text "because an application _can’t_ assume" should be "because an application _shouldn’t_ assume". We all know of appli...more...
B1.6
14-Oct-08
153
#35239: Directing readers to follow ("On line 3...", "on line 5...") a code snippet that is interrupted by 2 footnotes, a page break and a "Joe Asks.....more...
B1.6
14-Oct-08
157

#35869: the code for add_to_cart.js.rjs is missing the > to show that only the first line needs to be added to the code--Farhan Thawar

B1.6
13-Nov-08
161
#35436: Pretty minor but "and then run an SHA1 digest on the result" should be "and then run a SHA1 digest on the result". The former would be OK i...more...
B1.6
24-Oct-08
161
#35041: In the explanation of why we use 'self.salt = ....' it says: "... Without the self., Ruby would have thought we were assigning to a local v...more...
B1.6
09-Oct-08
163
#35019: I had omitted the "require 'digest/sha1'" from my User model and got all the way up to successfully login in before I noticed. Does it really ...more...
B1.6
08-Oct-08
166

#34233: Code sample appears truncated
<td><%= link_to 'Destroy', user, :confirm => 'Are you sure?', :method => :delet...*TRUNC*--Reuben Sivan

B1.5
25-Aug-08
167
#35588: There is a problem with the style sheet and the error flash. If no user name is entered and the form is submitted the layout jumps all over...more...
B1.6
03-Nov-08
167
#34206: Adding a user did not work for me until I restarted my server. I don't know why. Is RESTful routing not correctly generated until the server...more...
B1.5
23-Aug-08
167
#35559: My users/new page works, but does not look like the screenshot. Was the depot.css updated? Also, changing app/views/users/edit.html.erb wa...more...
B1.6
31-Oct-08
168
#36123: seem to be switching back and forth between 'redirect_to(:action=>:index)' (p165) and 'redirect_to(:action=>"index")' (p168). Be consisten...more...
B1.6
25-Nov-08
169
#34499: depot_p/app/views/admin/login.html.erb Bug: When attempting to log in without correct user-id/password, no errors are displayed. Solutio...more...
B1.5
14-Sep-08
170
#33034: When I got to this page and looked at the nice login form in figure 11.1, then compared it to the completely plain one in my application, I re...more...
B1.3
12-Jul-08
170
#33965: I had to do a "mongrel_rails restart" after adding admin controller. Was getting "No controller responded to.. etc.." when trying to view /ad...more...
B1.4
13-Aug-08
171

#34315: I had to restart my server after adding the admin controller, I didn't notice you mention that.--Wesley Tarle

B1.5
01-Sep-08
173
#34004: After rake:db:sessions:clear when using MySQL the app breaks. Mysql::Error: Lost connection to MySQL server during query: SELECT * FROM `...more...
B1.4
14-Aug-08
174
#35286: Why don't you remove app/views/layouts/order.html.erb like as product.html.erb and user.html.erb file? You generated order by call scaffold...more...
B1.6
16-Oct-08
174
#35050: at the beginning of 11.4 we add layout "store" and are told to visit 'admin', and only later the text mentions the need to remove references t...more...
B1.6
09-Oct-08
175
#34248: Shouldn't it be "<%= link_to 'Orders', :controller => 'admin' %>" rather than "<%= link_to 'Orders', :controller => 'orders' %>" ? (Same sa...more...
B1.5
26-Aug-08
177
#36277: The following piece of code miss an "@" flash[:notice] = "User #{user.name} deleted" It should be : flash[:notice] = "User #{@user.na...more...
B1.3
04-Dec-08
179
#35022: Re: "We created a virtual attribute representing the plain-text password and coded it to create the hashed version whenever the plain-text ver...more...
B1.6
08-Oct-08
179
#35023: Re second bullet point about GET/POST differences. I'm sorry, I went over it twice and can't see a thing relating to this. We updated the 'upd...more...
B1.6
08-Oct-08
180
#35541: When I issued the command "prd = Product.new" at the script/console the output I saw was: #<Product id: nil, title: nil, description: nil,...more...
B1.6
30-Oct-08
181

#36000: Some junk characters seem to have gotten into the Task G title page:
"spam∧H∧H∧H∧Hmailing" in the first paragraph--Ryan Neufeld

B1.6
19-Nov-08
183
#35386: The generate script also produces a view file: create app/views/info/who_bought.html.erb [Running under Rails 2.1.1 - not sure when/if ...more...
B1.6
21-Oct-08
184

#36157: 'curl' and 'wget' are not available on Windows boxes, please provide alternatives--Phil MacGovern

B1.6
28-Nov-08
185

#34355: per previous comment, add the triangle to the

format.html

line that was added for the change that was just made.--Dave Colburn

B1.5
06-Sep-08
186

#35053: we never added product id 1, the example should use 2 (or 3 or 4)--Reuben Sivan

B1.6
09-Oct-08
188

#34678: Then we provide a template, which makes use not only of the generic XML
functionality that builder proviles,--Christoph Ossner

B1.6
30-Sep-08
188

#35481: functionality that builder proviles, but also

should read

functionality that builder provides, but also--Brian

B1.6
26-Oct-08
193
#36256: In 13.2 Unit Testing of Models: The generated test classes by Rails 2.1 and newer start with require 'test_helper' instead of ...more...
B1.6
02-Dec-08
194
#34674: I think the list of files from "ls test/functional" may be out of date? In my depot directory at this point, I also have line_items_controller...more...
B1.6
29-Sep-08
197
#34278: On bottom of page, inside the following method: bad.each do |name| product = Product.new(:title => "My Book Title", :description => "yyy"...more...
B1.5
27-Aug-08
198
#34955: the 2nd line of the 2nd loop for the test_image_url method is truncated. It's easy to figure out but I wonder why the previous loop had each p...more...
B1.6
07-Oct-08
202
#34334: I found the placement of the code fragment (fig 13.1) at the top of this page (@@default_error_messages = ...) confusing, especially when it f...more...
B1.5
03-Sep-08
206
#34640: Agile Web Development with Rails 3nd Edition (Beta 1.3 - 20080604).pdf Building an Application - Task F: Administration - Iteration F2: L...more...
B1.3
26-Sep-08
210
#35483: "We have to remember to add the fixtures directive to the login controller test class. " would be better stated as "We have to remember ...more...
B1.6
26-Oct-08
210

#35557: "an SHA1 hash value" should be "a SHA1 hash value".

--Bill Colvin

B1.6
31-Oct-08
223
#34675: At the end of the section on unit tests, "rake test:units" runs cleanly, and the same with the section on integration tests. But at the end of...more...
B1.6
29-Sep-08
227

#33366: "We saw an example of multiple sessions in the test on page 225." The example actually starts on 226.

B1.3
30-Jul-08
227
#36040: I've read section 13.4 _thoroughly_. Several times. All the content describing the code for the integration test is fine and easily underst...more...
B1.6
21-Nov-08
227
#36041: [Separate] Suggestion: move the DSL content to the _end_ of section 13.4, rather than smack-bang in the middle where it effectively interrupts...more...
B1.6
21-Nov-08
240

#34750: "rake db:schema_migrations" instead of "rake db:schema_version",
since "task :schema_migrations"

B1.3
02-Oct-08
247

#35581: The Trac Timeline is no longer being used. This page should be updated to reflect Github/Lighthouse

B1.6
02-Nov-08
250
#34660: In section 14.4 "They’re surprised that they call a model class Person and Rails somehow knows to go looking for a database table called pe...more...
B1.6
28-Sep-08
256

#35587: The phrase "you’ll be in an ruby-debug session" should be "you’ll be in a ruby-debug session".

--Bill Colvin

B1.6
03-Nov-08
256

#35887: "You can list source, exhamine your stack frames," should be "You can list source, examine your stack frames,"--Robert Kosek

B1.6
14-Nov-08
258
#35840: In the demo that starts off section 15.1, you might want to add require 'activesupport' to the top of code block so that this could b...more...
B1.6
12-Nov-08
261

#36017: puts string.at(2) #=> "w"

Should that not read "o" instead of "w" as "o" is the 2nd character in the string?

i.e.

puts string.at(2) #=> "o"--James West

B1.6
20-Nov-08
262

#35582: Inflector should be ActiveSupport::Inflector

B1.6
02-Nov-08
266
#35390: My ruby version is 1.8.7 (pathlevel 72) and it already has Symbol#to_proc!!. Of course, rails 2.1.1's Symbol class still redefine to_proc meth...more...
B1.6
22-Oct-08
275
#34677: "If we were to run migrations again at this point, nothing much would happen. Each of the version numbers of the migration files would match ...more...
B1.6
30-Sep-08
278
#35597: In Figure16.1:Migration and Database Column Types db2 x :text should read: blob(32768) likewise oracle x :text should read blob ...more...
B1.6
04-Nov-08
285

#34095: Listing of foreign_key helper is partly coloured green (after hash signs) what is a bit misleading because these are not comments in fact.

--Marek Solak

B1.4
17-Aug-08
291

#35598: The phrase "you’ll have to weight the risks" should be "you’ll have to weigh the risks"

--Bill Colvin

B1.6
04-Nov-08
293

#35600: Based on the instructions in the demo section, "unit_price" should be "total_price".

--Bill Colvin

B1.6
04-Nov-08
312
#36107: You write the following: # Works User.find(:all, :conditions => ["name like ?" , params[:name]+"%" ]) However, I could be wrong, but I