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 4 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
0
#51478: This issue happens only with Kindle format of the book. When code listing is too wide, right part of it is cropped. Example is at location 5...more...
B2.0
08-May-13
4
#52425: The section on installing on Windows suggests that the simplest way to set up the Rails stack is to use railsinstaller.org I have just talk...more...
B5.0
20-Aug-13
41
#76436: Where it says "Keys in a particular hash must be unique—you can’t have two entries for :drum.", should say "Keys in a particular hash are uniq...more...
P1.0
17-Feb-14
42
#53107: "In effect, though, you can ignore that it’s a hash and pretend that Ruby has keyword arguments." It sounds like this should have been upda...more...
P1.0
01-Nov-13
43
#52429: On page 41 in "Ruby Names" you mention that a name prefixed with a colon is a symbol (e.g. :symbol). On page 43 in "Arrays and Hashes" you m...more...
Sam Ruby says: A symbol may be a key; from the text of the book: "The use of symbols as hash keys is so commonplace that starting with Ruby 1.9 there is a special syntax for it, saving both keystrokes and eyestrain."
B5.0
20-Aug-13
47
#53134: The following sentence contains a query string within the URL, meaning a GET request is performed. However, the sentence indicates that a POST...more...
Sam Ruby says: One can indeed POST to a URL containing a query string, and in fact, the Depot application does this.
P1.0
10-Nov-13
47

#53191: Mention of impossibility of instantiating modules. But subsequent statement says "module's instance method".--Raj

P1.0
21-Nov-13
58
#76473: In introducing methods, you make use of a return statement that is in practice unwarranted since Ruby methods return their last-evaluated expr...more...
Sam Ruby says: The example shows how a return statement could be used; and the subsequent prose says that return is optional.
P1.0
04-Mar-14
72

#76808: Hyperlink for downloading index.html.erb points to incorrect content.--Kevin Buchs

Sam Ruby says: How is the content incorrect?
P2.0
20-May-14
75
#76809: Seems there is a sentence or two missing from this content in the colored box: "A GET request is defined by HTTP to be used to retrieve data;...more...
Sam Ruby says: The previous paragraph introduced the method parameter; I reworded these two sentences to make it clearer.
P2.0
20-May-14
76
#52962: In the /index.html.erb file, the list_description class needs to be added to the <table> tag not the <td> tag. As it stands, the css is not be...more...
Sam Ruby says: The list_description class is meant to cover the description; the Show/Edit/Destroy links are covered by the list_actions class.
B6.0
21-Sep-13
79
#76441: "Why test against 1 cent, rather than zero? Well, it’s possible to enter a number such as 0.001 into this field. Because the database stores j...more...
Sam Ruby says: Sqlite3 doesn't directly support decimal data types; but database managers that are intended for use in production do. At this point in the book, we are just introducing concepts here, so I don't want to delve into more advanced topics like differences in databases.
P1.0
21-Feb-14
79
#76480: I think that, regarding the numerical validation of the price, it must be stressed that errors could also be produced by storing legal but uni...more...
Sam Ruby says: This is meant to be an introduction to validation at this point.
P1.0
05-Mar-14
81

#76973: $ rails g migration add_image_to_pins image:string

Do you mean?

$ rails g migration add_image_to_pins image_cache:string--Ricardo

Sam Ruby says: I don't see anything remotely like this text in this book.
P2.0
08-Jul-14
81
#76974: 4 These uploadersare reusable and the same one can be mounted on multiple models in our pinmodel: app/uploaders/image_uploader.rb (WRONG, T...more...
Sam Ruby says: I don't see anything remotely like this text in this book.
P2.0
08-Jul-14
82

#53041: The link to the MiniTest docs at the bottom of the page is broken.--Martín Raúl Villalba

P1.0
21-Oct-13
86
#76832: Link on the top of the fixtures has changed in recent rails version (4.1.1) from Fixtures.html to FixtureSet.html So: api.rubyonrails.org/...more...
P2.0
02-Jun-14
86

#52957: Link in footer to Mini Test in rdoc is broken, remove /unit and the link works.--Justin Hiltz

B6.0
20-Sep-13
91
#53363: To get the file products/index.html.erg to render properly in Firefox I had to add 'class="product"' (no single quotes) to the opening table t...more...
Sam Ruby says: class="products" should have been added to the body tag on page 75; I can't explain why comments in the css file wouldn't work (note: I develop using Firefox).
P1.0
18-Dec-13
93
#76847: legend for Figure 16 Template not found should not be that as the template index.html.erb, is created when using the rails scaffold control...more...
P2.0
09-Jun-14
98

#52407: Product description overwrites image unless I put it in <p></p> tags.

<p>
<%= sanitize(product.description) %>
</p>--Todd Crone

Sam Ruby says: I can't reproduce this problem
B5.0
18-Aug-13
98
#52444: sanitize(product.description) removes any html tags and hence it will never be nicely printed "to make the descriptions more interesting for o...more...
Sam Ruby says: sanitize only removes unsafe html tags
B5.0
23-Aug-13
100 86

#52940: "Document not found" for MiniTest1 framework URL--Chris Seelus

B6.0
16-Sep-13
104
#53259: Book say to change this flag to true to enable caching: config.action_controller.perform_caching = true But it doesn't work without this...more...
P1.0
01-Dec-13
104
#76990: config/environments/development.rb only after setting both of the following to true did caching work properly config.cache_classes = true...more...
P2.0
12-Jul-14
108
#53002: There is no introduction or explanation as to the purpose of controllers/concerns. It appears without hardly any context. What is a concern us...more...
P1.0
01-Oct-13
108

#53092: The paragraph under current_card.rb states, that the code finally returns the new cart. As I see it, it doesn't, but returns the cart's id!--Stefan Otto

P1.0
30-Oct-13
108

#76965: Not to sure what to do with the code on the top of the page, not clear instructions.--poojan shah

Sam Ruby says: I can't track down what code is being referenced based on this description.
P2.0
07-Jul-14
112
#52625: The controller/concerns folder, introduced on page 112...I don't think there was any meaningful description about it prior two this page. It'...more...
B6.0
12-Sep-13
112
#52990: Please discuss the creation of a new file and the purpose of the controller/concerns folder. Nothing says outright that "we are going to creat...more...
B6.0
27-Sep-13
113

#76614: The correct way of accessing `product_id` from request's params is: params[:line_item][:product_id], not params[:product_id]

Sam Ruby says: I don't know how this reader came to that conclusion. Data from the log: Started POST "/line_items?product_id=3" for 127.0.0.1 at 2014-07-08 23:04:47 -0400 Processing by LineItemsController#create as */* Parameters: {"product_id"=>"3", "authenticity_token"=>"6eQBpEQn892GZL/TVaPtAXHe/TKl32Q8S3mKrF1jSf8="}
P2.0
04-Apr-14
116
#52463: Improve the implementation of "ensure_not_referenced_by_any_line_item" method. Since it does not follow the standard Ruby conventions. For exa...more...
B5.0
25-Aug-13
118
#52997: In the tenth-eleventh line from bottom, there is a space between "command" word and period sign: "... automatically by the scaffold command ....more...
B6.0
29-Sep-13
120
#76349: Hello People, Thanks for the fantastic reference. Maybe its just my lack of understanding here, but the following code (from the book) seem...more...
Sam Ruby says: Each cart has a collection of line_items that are specific to that cart. Therefore there is no need to specify the cart in a find operation over the list of line_items for that specific cart. If there is any magic involved here it is that the Cart.line_items.build method will automatically fill in the cart.
P1.0
30-Jan-14
124
#53076: Your code for show.html.erb at the bottom of the page doesn't fix the DRY issue. I believe it should be: <% if notice %> <p id="notice"><%= ...more...
Sam Ruby says: The DRY issue is addressed in iteration F1
P1.0
24-Oct-13
125

#52235: Footnote '2' link bellow page giving 404 not found error:

guides.rubyonrails.org/debugging_rails_applications.html%23the-logger--Frank Betorina

Susannah Davidson Pfalzer says: Frank, thank you for alerting us about this. We're trying to reproduce the problem - could you please let us know what PDF viewer you're using and what method you are using for accessing the page? (I.e., are you clicking on the link, or copying and pasting it in the browser?) - Susannah Pfalzer, editor
B4.0
25-Jul-13
125
#53028: I am reading a book P2.2 from 2012 and studying Rails4. I found a typo in the examples data from media.pragprog.com/titles/rails4/code/rails4-...more...
Sam Ruby says: http://media.pragprog.com/titles/rails4/code/rails40/depot_i/test/models/cart_test.rb I see two tests. The first defines and uses book_one and book_two. The second defines and uses ruby_book.
B1.0
16-Oct-13
127

#52236: Footnote '3' link bellow page giving 404 not found error:

github.com/rails/strong_parameters%23readme

B4.0
25-Jul-13
127
#76468: Even after applying the changes, notably to the destroy method in the carts controller, I'm still capable of browsing to which ever cart I lik...more...
Sam Ruby says: This hole is closed in Iteration I3: Limiting Access
P1.0
03-Mar-14
129
#54870: Between pages 129 and 130, essentially in the middle of a paragraph, while we are still talking about making a smarter cart, the sample codeba...more...
Sam Ruby says: This is why the Playtime exercises encourage you to use git.
P1.0
20-Dec-13
140
#53200: (FYI the problems here could be due to changes in jQuery UI implementation) The inclusion of: form, div { display: inline; } insi...more...
P1.0
23-Nov-13
143
#53077: Adding this to application.js no longer works: //= require jquery-ui After about 15 minutes of fighting, I found this works: 1. gem insta...more...
P1.0
24-Oct-13
147
#77019: In Iteration F3:Highlighting Changes the jQuery-UI library has been updated and the syntax for the entry in application.js to include the Blin...more...
P2.0
17-Jul-14
149
#76583: In the second paragraph, it says: "With that change in place, click any Add to Cart button, and you’ll see that the changed item in the cart g...more...
P1.0
30-Mar-14
149

#76584: In the cited code for the _cart partial, the line

<div class="cart_title">Your Cart</div>

should be

<h2>Your Cart</h2>

and that's all!--Antonio Vera

P1.0
30-Mar-14
150
#76585: The code to put in create.js.erb seems wrong in two aspects: first, the line we add should be added between the two existing lines, otherwise ...more...
P1.0
30-Mar-14
150
#76586: The animation done with Jquery's 'show' just doesn't work. The cart is shown, but the changes are not animated. I also had the same problem wi...more...
P1.0
30-Mar-14
153
#76865: Iteration F5, rails40/depot_n/app/assets/javascripts/store.js.coffee Rails 4.0.5, Turbolinks 2.2.2 The handler registered by $(document).o...more...
P2.0
15-Jun-14
153

#52988: 11.4 Iteration F4

code has not specific location--Chang Ju Park

Sam Ruby says: That code demonstrates a potential approach. The actual changes which are made identify the specific location.
B6.0
27-Sep-13
153
#59903: $(document).on "ready page:change", -> $('.store .entry > img').click -> $(this).parent().find(':submit').click() produces that produc...more...
P1.0
06-Jan-14
156

#53153: assert_select 'tr#current_item td', /Programming Ruby 1.9/
The dot in the RegEx should be escaped.--Patrick P. Henley

P1.0
15-Nov-13
159 147
#77020: depot code jquery-ui effect blind import: in depot code the app/assets/javascripts/application.js lists the import: " //= require jquer...more...
P2.0
17-Jul-14
164
#76879: in the scaffold code generated by rails (4.1) the following: <% @order.errors.full_messages.each do |msg| %> <li><$= msg %></li> <% end...more...
P2.0
20-Jun-14
166
#52562: In the paragraph beginning "Not surprisingly" you mention "our existing .js.erb template". It might better be phrase "our existing create.js.e...more...
B6.0
02-Sep-13
169
#53248: Pg 169 includes the 2nd of two adjustments to orders_controller_test.rb in chapter (12 "Check Out"). However, the chapter has no steps for run...more...
P1.0
30-Nov-13
187
#76886: Should the line: order = orders[0] be better placed in the following section of code since it is logically related to the following asse...more...
P2.0
23-Jun-14
191

#52385: Trivial, but you need to sanitize line_item.product.title in _line_item.text.erb. Buy "Programming Ruby 1.9 & 2.0" and you'll see why!--David Cunningham

B5.0
14-Aug-13
194
#76278: The changes made to the default '_form.html.erb' file (to improve the appearance of the user creation/modification form) created by the Rails ...more...
P1.0
10-Jan-14
196
#76887: Wouldn't it be better if there is a note that emphasises that in testing the create method in the user controller the user name (ie 'sam') sho...more...
P2.0
24-Jun-14
198
#76704: In the paragraph after the form code, there's this phrase, which describes the parameters of the *_field_tag helpers: "The first is the name t...more...
P2.0
21-Apr-14
200

#53102: The route mapping delete 'logout' => :destroy does not work. --enddy dumbrique

P1.0
31-Oct-13
200

#76279: Should the route "delete 'logout' => :destroy" perhaps instead be "get 'logout' => :destroy" to permit logging out via a standard link in a browser?--Daniel Carter

P1.0
10-Jan-14
221

#58769: "Carrito bonita" -> "Carrito bonito"
because
carrito nombre masculino--Alexander Moiseyev

P1.0
27-Dec-13
246
#76810: "Substitute your host’s name and your application’s directory path in the fol- lowing ServerName line" should be "Substitute your host’s...more...
P2.0
21-May-14
289
#76874: Under the "Subsetting the Records Returned" heading, the text first alludes to the "all()" method but then refers to the "to_a()" method. I am...more...
P2.0
18-Jun-14
381

#52977: In the first line in the list the 'object' and 'blob' seem to be out of place. Adding cell borders might be a good idea to improve readablity.

B6.0
23-Sep-13
2125
#52447: On kindle at location 2125, the link that points to "configuring a database" section of guides.rubyonrails.org is pointing to the wrong place....more...
B5.0
24-Aug-13