small medium large xlarge

The latest version of the book is P2.0, released 6 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.

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

If you've found a new error, please submit it.

  • Typo
  • Tech. error
  • Suggestion
  • Maybe next edition
  • Not a problem
  • Reported in: P1.0 (09-Dec-16)
#80963
PDF page: x
Paper page: x
Just info: I bought this book 5 weeks ago in the Netherlands. The errata list is pretty useless if you only reference PDF page numbers! Regards Wim--...more...
Sam Ruby says: Best to report this to support@pragprog.com?
  • Reported in: P1.0 (14-Apr-17)
#81408
PDF page: 17
The fourth paragraph on page xvi should be rephrased: “So if this book gives you the basics to build on, helps you phrase the right questions, and hel...more...
  • Reported in: P1.0 (19-Mar-17)
#81208
PDF page: 39

Choosing a Rails Version
...
$ rails _5.0.0.1 --version
missing underscore--villu164

  • Reported in: P1.0 (11-Mar-17)
#81191
PDF page: 76
The New Product page generated by scaffold is not like the one shows, but is a little bit messed, as if css has not been correctly applied. What's wro...more...
Sam Ruby says: This is not enough information to reproduce the problem you are seeing; perhaps we should discuss this on the forum?
  • Reported in: P1.0 (06-Feb-17)
#81102
Paper page: 90
updated Product model: rails50/depot_b/app/models/product.rb (page 90) class Product < ApplicationRecord validates :title, :description, :image_ur...more...
Sam Ruby says: Vertical bar (as is shown in the book) is correct.
  • Reported in: P1.0 (08-Dec-16)
#80961
PDF page: 93
The product_test.rb file that gets downloaded has 2 faults. Line 62 says: product = Product.new(title: products(:ruby).title Line 62 should sa...more...
Sam Ruby says: The ruby product was added to products.yml on the previous page.
  • Reported in: B6.0 (26-Sep-16)
#80762
PDF page: 94
When running only the model tests with bin/rails test:models the output should be: 1 runs, 5 assertions, 0 failures, 0 errors, 0 skips and not:...more...
Sam Ruby says: That's not what I'm seeing: http://intertwingly.net/projects/AWDwR4/checkdepot-50/section-7.2.html#cmd5
  • Reported in: P1.0 (19-Mar-17)
#81210
PDF page: 100
... This uses the create!() method ... but in both the seeds file and the excerpt, it uses create() which doesn't raise exceptions like promised in ...more...
  • Reported in: P1.0 (25-Mar-17)
#81278
Paper page: 102

localhost link is split with a hyphen. local-host:3000/store/index
--villu164

  • Reported in: P1.0 (18-Apr-17)
#81440
Paper page: 106
When completing Iteration C2 on page 106 of the printed book, we are instructed to create a banner and sidebar by modify the application.html.erb file...more...
  • Reported in: P2.0 (21-Jun-17)
#81707
PDF page: 107
The File indicated is : "app/assets/stylesheets/application.scss" but there is application.css file generated. i.e : "app/assets/stylesheets/app...more...
  • Reported in: P2.0 (01-Aug-17)
#81912
Paper page: 109
After applying all CSS code for chapter 8, the web forms do not open with the menu displayed in their own side bar (as is the case on page 110). Shoul...more...
  • Reported in: P1.0 (10-Oct-16)
#80802
PDF page: 122

The form, div section for the CSS file should be underneath the price section if we have the two closing brackets.
--Kosmas Chatzimichalis

Sam Ruby says: The location is correct as is: it is meant to style form elements contained within the price_line.
  • Reported in: P1.0 (25-Mar-17)
#81288
Paper page: 126

"...where the cart ID is internal state data residing a cookie." (missing "in" or "inside" before "a cookie").--Matthew Braun

  • Reported in: P1.0 (18-Oct-16)
#80815
PDF page: 147

The code for the show.html.erb already exists, so shouldn't it be displayed without the arrows that indicate new code?
--Kosmas Chatzimichalis

Sam Ruby says: 5 lines (<tr>...</tr>) were replaced with one (render(...)).
  • Reported in: P1.0 (04-Apr-17)
#81354
Paper page: 152
The highlighted line in the screenshot is "<% render @cart %>" but the text underneath and describing the screenshot reads "From this, we see that the...more...
  • Reported in: P1.0 (18-Jan-17)
#81068
PDF page: 154
Paper page: 134
In the code of test/controllers/line_items_controller_test.rb you say to add the line assert_select 'li', "1 \u00D7 Programming Ruby 1.9" but i expe...more...
Sam Ruby says: I can't reproduce. Assert select tests to make sure that there is at least one match for the expression; scoping the test to #main shouldn't make it pass. The test should pass without that addition: http://intertwingly.net/projects/AWDwR4/checkdepot-50/section-10.1.html#cmd23
  • Reported in: P1.0 (22-Mar-17)
#81219
PDF page: 158
Now that we have the jQuery-UI library jQuery-UI library available to our application Should read Now that we have the jQuery-UI library availab...more...
  • Reported in: P1.0 (22-Mar-17)
#81220
PDF page: 158
//= require jquery-ui/effect-blind Has changed now to //= require jquery-ui/effects/effect-blind Using the //= require jquery-ui/effect-blind w...more...
  • Reported in: P1.0 (24-Oct-16)
#80828
PDF page: 159
Wouldn't it be better if the lines following the if and else in the _line_item.html.erb partial are indented two spaces? <% if line_item == @curren...more...
Sam Ruby says: I only do that when the whole element is enclosed by the if statement. In this case, only the open tag for the tr element varies.
  • Reported in: P2.0 (07-Jun-17)
#81659
Paper page: 160
In the 'should create line_item with Ajax' test you wrote assert_select 'tr#current_item td', /Programming Ruby 1.9/ but this is a regex, and th...more...
  • Reported in: P1.0 (09-Apr-17)
#81381
Paper page: 163
It would be clearer to write <% render @cart %> instead of <%= render @cart %> in my opinion, since the string returned by render it isn't actually r...more...
  • Reported in: B5.0 (12-Sep-16)
#80711
PDF page: 180
I have just looked for the issues in version 4 and found that this fix in products controller works: ~~~~ before_action :set_product, only: [:sh...more...
Sam Ruby says: Not needed given that the first line of who_bought is: @product = Product.find(params[:id])
  • Reported in: P1.0 (26-Jan-17)
#81081
PDF page: 180
This section involves revealing the cart when an item is added to it. This line is added to the app/views/line_items/create.js.erb file: if ($('#ca...more...
Sam Ruby says: This isn't doing animation on a table row. It is checking the number of rows and then doing the animation on the entire table.
  • Reported in: P1.0 (10-Apr-17)
#81384
Paper page: 204
rails g scaffold User password:digest This creates a database column named password with a 'type' of digest. This failed for me because it appears ...more...
  • Reported in: P1.0 (07-Apr-17)
#81366
Paper page: 215
def setup login_as users(:one) end end "Note that the setup() method will call login_as() only if session is defined." Perhaps you can e...more...
  • Reported in: B5.0 (06-Sep-16)
#80697
PDF page: 218
In the line_items_controller test I believe that the suggested assert: “assert_select ​'li'​, ​"1 ​​\u​​00D7 Programming Ruby” Should actually b...more...
Sam Ruby says: It works as is. What this test is stating is that there is at least one list item that contains the specified string.
  • Reported in: P1.0 (20-Mar-17)
#81215
Paper page: 225
It seems that some lines are missing , just before the "end" last line of the sample code. These should be the followings: > def defaults_url_o...more...
  • Reported in: B6.0 (27-Sep-16)
#80767
PDF page: 231
While translation for layouts.application.title is provided, it is not used in the template cited on page 230 and 243. Perhaps the following is your ...more...
Sam Ruby says: Actually, it is used thus: <h1><%= t('.title_html') %></h1>
  • Reported in: P1.0 (07-Apr-17)
#81367
Paper page: 237
"but the names of the model and the attributes bleed through the interface...We need to provide translations for each." comes *after* the screenshot s...more...
  • Reported in: P2.0 (09-Aug-17)
#81936
PDF page: 239
I added the code to implement the locale switcher. When I selected a different locale, I got an error that there was no route for POST '/'. I didn't s...more...
  • Reported in: B6.0 (19-Sep-16)
#80735
PDF page: 252
After passenger installed, before accessing depot appliction from browser, I think it is better to run 'rails assets::precompile' because default envi...more...
Sam Ruby says: I tested it again, and it worked without this addition.
  • Reported in: B6.0 (17-Sep-16)
#80734
PDF page: 262
In iteration J4, I encountered ActionController::RoutingError when I changed language selection. ActionController::RoutingError (No route matches [...more...
Sam Ruby says: I can't reproduce
  • Reported in: P1.0 (09-Oct-16)
#80797
PDF page: 370

How about adding to explain adding routings to upload files into routes.rb?

--Masaki Suketa

Sam Ruby says: Nothing special is required for a route.
  • Reported in: P1.0 (10-May-17)
#81526
Paper page: 405
"Others include an optional :require parameter..." but none of the lines in the sample Gemfile on pages 403-404 actually have "require". --Matthew Br...more...
  • Reported in: P1.0 (10-May-17)
#81527
Paper page: 406
"...when you run the command rails server, a file named config.ruis provided". In the print version, for some reason, "config.ru" and "is" appear to b...more...
  • Reported in: P1.0 (10-May-17)
#81528
Paper page: 421
"First we modify our controller to call paginate(), but that doesn't correspond to the following source line as there is no call to paginate: @or...more...
  • Reported in: P1.0 (08-Apr-17)
#81375
PDF page: 2728
I think here where you've added `assert product.errors[:image_url].any?` Meaning we are saying there should be an error if there isn't an image_u...more...

Stuff To Be Considered in the Next Edition

  • Reported in: B6.0 (19-Sep-16)
#80736
PDF page: 192

I'd like to know how to test functionality implemented with ActionCable.
--Masaki Suketa

Sam Ruby says: Unfortunately, Rails doesn't yet have an answer for this: See https://github.com/rails/rails/pull/23211 for progress.