By Developers, For Developers

Historical errata for Agile Web Development with Rails 6

PDF PgPaper PgTypeDescriptionFixed onComments
11ERROR

Next, run this command to update Rails to the version used by this book:
$ gem install rails —version=6.0.0.beta3 —no-ri —no-rdoc
1
@Lykos —no-doc —no-ri is deprecated (see guides.rubygems.org/command-reference/#gem_install for options) – Slava V Jan 25 ’18 at 18:39

Use:
install: —no-document

2019-06-04
10OK

Open the terminal and run the following command:
> ruby -e "$(curl -fsSL \\ …

I had to use “/usr/bin/ruby” instead of “ruby” to get this to work for me on MacOS Mojave.

2019-10-23The official homebrew instructions say ruby.
82ERROR

You given no link or istructions to download the images (in this case “ridocker.jpg”) in img asset. Conseguence is an action controller exception that no rails experienced people cannot easily resolve.

2019-10-02
163ERROR

In the file create.js.erb, the cart is stored in a variable:

let cart = document.getElementById(‘cart’)

The first time an “Add to cart” button is clicked, this works. But subsequent times, an error is thrown because the cart variable is declared again within the same scope. A fix would be to use var instead of let:

var cart = document.getElementById(‘cart’)

2019-10-03
11ERROR

The “brew install chromedriver” in the Installing on Mac OS X outputs this error:

$ brew install chromedriver
Error: No available formula with the name “chromedriver”
Found a cask named “chromedriver” instead.

According to this link (removed) that command is Inactive:

This link (removed) has a solution:

brew cask install chromedriver

Note - should all references in the book to Mac OS X now be changed to MacOS? Removed link to Wikipedia article

- Tony Dehnke

2019-06-04
88OK

Change the font in the PDF - the regular body text is very squished and renders poorly (at least for me on MacOS 10.14.4). Can send a screen shot if you like.

2019-11-15Hi, Tony. Please check your settings. It could be the viewing percentage might not be high enough. If you're still having issues after you increase the percentage, please let me know.
181TYPO

Halfway the second paragraph, a code snippet says:

module: @order

This should be:

model: order

(The first argument, module: @order tells the helper…)

2019-10-17
10ERROR

I start using Ruby and Rails back in 2006. Stopped for a while and I’m now trying to come up to speed with the latest version so I picked the beta version 6.

The book says to use the —no-ri and —no-rdoc but with ruby 2.6.3p62 (“gem” version 3.0.3), those options are gone. I looked at the older version of gem (version 2.5.2.3) and they are deprecated in favor of —no-document

For newbies, and given that this is in the version 6 of the book, I would put the new rather than the old.

2019-06-04
allOK

More of a question… with the PDF, there are links at the bottom of each page to get me to this form. Can something like that be implemented in the epub format so it shows up in iOS Books?

2019-10-23Hi, Perry. Unfortunately, since the epubs don't have actual pages like the pdfs do, there isn't a way for us to add these inks.
11ERROR

Repeat of the brew chromedriver issue but now the brew messgae is:

brew install chromedriver
Error: No available formula with the name “chromedriver”
It was migrated from homebrew/core to homebrew/cask.
You can access it again by running:
brew tap homebrew/cask
And then you can install it by running:
brew cask install chromedriver

The two step sequence “worked” in that it installed soemthing :-)
It asked for my admin password in the process…

2019-06-04
78ERROR

Page 78 footnote 3 has a URL to download the images. I get a 403 Forbidden error. The seeds.rb URL (footnote 2) works fine.

2019-10-02
99OK

Not sure if I have done something wrong, but while running the tests from pages 95-99, I’m getting some fails for the products_controller_test, and I don’t think I should be seeing those at this point?:

  1. Running:

F

Failure:
ProductsControllerTest#test_should_create_product [/Users/tdehnke/workspace/pragmatic/agile/depot6/test/controllers/products_controller_test.rb:19]:
“Product.count” didn’t change by 1.
Expected: 4
Actual: 3

rails test test/controllers/products_controller_test.rb:18

F

Failure:
ProductsControllerTest#test_should_update_product [/Users/tdehnke/workspace/pragmatic/agile/depot6/test/controllers/products_controller_test.rb:38]:
Expected response to be a <3XX: redirect>, but was a <200: OK>

2019-11-15Sadly, this is not enough information for me to reproduce the problem.
110TYPO

Should the <main class …. be so far to the right of the rest of the code in the application.html.erb view in from this page?

2019-10-02
129TYPO

Pretty sure the screen shot is not correct on this page - Should be showing the Add to Cart button, but it’s not.

Also - the Add to Cart button still looks the same for me even after adding the CSS formatting on page 128/129 for the button?

2019-11-15This appears to have been fixed in the current beta
131TYPO

Incorrect Screen Shot - does not show the result of Add to Cart

PS - it would be great if we could upload screen shots when submitting these. Also would be nice if we didn’t have to do the Captcha every time, especially if we are logged into our pragprog.com store account when submitting.

2019-11-15This appears to have been fixed in the current beta
132TYPO

Screen Shot incorrect - does not show the Notice box.

2019-11-15This appears to have been fixed in the current beta
11SUGGEST

The rbenv install instructions contains the following…
Compatibility note: rbenv is incompatible with RVM. Please make sure to fully uninstall RVM and remove any references to it from your shell initialization files before installing rbenv.
This probably should be mentioned in the book, which in previous versions used RVM. Odd things happen if you don’t.

2019-10-17
1OK

I’m surprised there is no longer a deployment section of the book. And the book “Deploying Rails Applications” hasn’t been updated since its original release in 2008 — over a decade ago. Any suggestions for where to go for current best practices for rails deployment?

2019-10-23These days containers/kubernetes is the way to go, and that topic is way out of scope for a book focused on Rails beginners.
11OK

Ditto with the deploy comment. Would love to see some kind of addenda, particularly for the non-devops crowd.
(Docker based to heroku maybe? Linode or Digital Ocean? Another platform?)

2019-10-23These days containers/kubernetes is the way to go, and that topic is way out of scope for a book focused on Rails beginners.
292TYPO

On page 292 of the book in iBooks, the sentence reads, ‘We’re instead redirecting to the cart, where the cart ID is internal state data residing a cookie.’ It should read, ‘We’re instead redirecting to the cart, where the cart ID is internal state data residing in a cookie.’ The word ‘in’ is missing.

2019-10-17
326TYPO

On page 326 in iBooks, in the carst.scss file, in the tfoot portion, it states ‘td.price’, where is should state ‘th.price’. This happens twice in this file.

2019-10-17
78ERROR

Footnote #3 comes back with forbidden status

2019-10-02
11ERROR

When trying to install ChromeDriver using brew install I get this error message:

$brew install chromedriver
Error: No available formula with the name “chromedriver”
Found a cask named “chromedriver” instead.

If, instead I install like this:

$brew cask install chromedriver

It installs fine.

2019-06-04
23SUGGEST

The text says:

“If you want to enable this server to be accessed by other machines on your network, you can specify 0.0.0.0 as the host to bind to:
demo> bin/rails server -b 0.0.0.0”

However, trying to actually reach the Rails app from another computer, I had to add a line to the corresponding configuration (config/environments/development.rb):

config.hosts << “#{local_hostname_here}”

Actually, the Rails app told me so:

Blocked host: #{local_hostname_here}
To allow requests to #{local_hostname_here}, add the following to your environment configuration:

config.hosts << “#{local_hostname_here}”

I suggest to add a line or two explaining this to the corresponding section.

config.hosts << ‘seaside.local’

2019-06-04
27TYPO

“That’s the template file is named hello.html.erb” proabbly should been “That’s why the template file is named hello.html.erb”

2019-10-02
11ERROR

chromedriver is now a brew cask,
that’s why the installation is not correct,
at first you have to at cask with
brew tap homebrew/cask
and then install the chromedriver with
brew cask install chromedriver

2019-10-02
411TYPO

“rake” vs “bin/rails” typo.

“You can force the database to a specific version by supplying the VERSION= parameter to the rake db:migrate command:

​depot>​​ ​​bin/rails ​​db:migrate​​ ​​VERSION=20190425000009”

Personally, I kinda miss rake, but as you know: “Since Rails 5.0+ has rake commands built into the rails executable, bin/rails is the new default for running commands.”
From: The Guides - command_line #bin-rails

2019-10-17
437ERROR

“In Part II, you iteratively built an application, built up test cases along the way, and ultimately deployed it using Capistrano. We designed this application to touch on all aspects of Rails that every developer needs to be aware of.”

This is the only location in the entire book where Capistrano is mentioned.

2019-10-17
110TYPO

javascript_include_tag() should update to javascript_pack_tag()

2019-10-03
114ERROR

Wrong Screenshot.
Background color of Sidebar and Header (as per application.scss) is Green.

2019-10-17
163TYPO

using ‘let’ will not allow to add more than 1 time.
Js error will display “cart already declared” in browser dev console.

rails6/depot_l/app/views/line_items/create.js.erb
let cart = document.getElementById(“cart”) cart.innerHTML = “<%= j render(@cart) %>”

2019-10-03
4ERROR

rails-dev-box setup process Fails on fresh Ubuntu install.

libvirt is not installed in the /var/run/libvirt directory from package manager…

vagrant up script breaks with an error.

2019-11-17We have changed the setup to not use rails-dev-box for the next release
4SUGGEST

Ubuntu 18.04:
ref: rails-dev-box vagrant up

New vagrant install from aptitude breaks for this command…

Must be installed from developer website and it then works.

2019-11-17
77OK

“bin/rails test” cases error:

➜ depot git:(master) ✗ bin/rails test
Running via Spring preloader in process 56508
Run options: —seed 3899

  1. Running:

Traceback (most recent call last):
\t28: from -e:1:in `


\t27: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require’
\t26: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require’
\t25: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>’
\t24: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:139:in `run’
\t23: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop’
\t22: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run’
\t21: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:175:in `serve’
\t20: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:175:in `fork’
\t19: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/gems/2.6.0/gems/minitest-5.11.3/lib/minitest.rb:63:in `block in autorun’
\t18: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/gems/2.6.0/gems/minitest-5.11.3/lib/minitest.rb:133:in `run’
\t17: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:70:in `start’
\t16: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:70:in `map’
\t15: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:70:in `each’
\t14: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:70:in `times’
\t13: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:71:in `block in start’
\t12: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:71:in `fork’
\t11: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:91:in `block (2 levels) in start’
\t10: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1138:in `method_missing’
\t 9: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1158:in `with_friend’
\t 8: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1139:in `block in method_missing’
\t 7: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1213:in `open’
\t 6: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1213:in `synchronize’
\t 5: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1216:in `block in open’
\t 4: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1216:in `each’
\t 3: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1218:in `block (2 levels) in open’
\t 2: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1262:in `alive?’
\t 1: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1005:in `alive?’
/Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1005:in `wait_readable’: Bad file descriptor (Errno::EBADF)
Traceback (most recent call last):
\t28: from -e:1:in `


\t27: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require’
\t26: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require’
\t25: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>’
\t24: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:139:in `run’
\t23: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop’
\t22: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run’
\t21: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:175:in `serve’
\t20: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:175:in `fork’
\t19: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/gems/2.6.0/gems/minitest-5.11.3/lib/minitest.rb:63:in `block in autorun’
\t18: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/gems/2.6.0/gems/minitest-5.11.3/lib/minitest.rb:133:in `run’
\t17: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:70:in `start’
\t16: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:70:in `map’
\t15: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:70:in `each’
\t14: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:70:in `times’
\t13: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:71:in `block in start’
\t12: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:71:in `fork’
\t11: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:91:in `block (2 levels) in start’
\t10: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1138:in `method_missing’
\t 9: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1158:in `with_friend’
\t 8: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1139:in `block in method_missing’
\t 7: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1213:in `open’
\t 6: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1213:in `synchronize’
\t 5: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1216:in `block in open’
\t 4: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1216:in `each’
\t 3: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1218:in `block (2 levels) in open’
\t 2: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1262:in `alive?’
\t 1: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1005:in `alive?’
/Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1005:in `wait_readable’: Bad file descriptor (Errno::EBADF)
Traceback (most recent call last):
\t28: from -e:1:in `


\t27: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require’
\t26: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require’
\t25: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>’
\t24: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:139:in `run’
\t23: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop’
\t22: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run’
\t21: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:175:in `serve’
\t20: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:175:in `fork’
\t19: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/gems/2.6.0/gems/minitest-5.11.3/lib/minitest.rb:63:in `block in autorun’
\t18: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/gems/2.6.0/gems/minitest-5.11.3/lib/minitest.rb:133:in `run’
\t17: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:70:in `start’
\t16: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:70:in `map’
\t15: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:70:in `each’
\t14: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:70:in `times’
\t13: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:71:in `block in start’
\t12: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:71:in `fork’
\t11: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:91:in `block (2 levels) in start’
\t10: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1138:in `method_missing’
\t 9: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1158:in `with_friend’
\t 8: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1139:in `block in method_missing’
\t 7: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1213:in `open’
\t 6: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1213:in `synchronize’
\t 5: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1216:in `block in open’
\t 4: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1216:in `each’
\t 3: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1218:in `block (2 levels) in open’
\t 2: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1262:in `alive?’
\t 1: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1005:in `alive?’
/Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1005:in `wait_readable’: Bad file descriptor (Errno::EBADF)
Traceback (most recent call last):
\t28: from -e:1:in `


\t27: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require’
\t26: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require’
\t25: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>’
\t24: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:139:in `run’
\t23: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop’
\t22: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run’
\t21: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:175:in `serve’
\t20: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/spring-2.1.0/lib/spring/application.rb:175:in `fork’
\t19: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/gems/2.6.0/gems/minitest-5.11.3/lib/minitest.rb:63:in `block in autorun’
\t18: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/gems/2.6.0/gems/minitest-5.11.3/lib/minitest.rb:133:in `run’
\t17: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:70:in `start’
\t16: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:70:in `map’
\t15: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:70:in `each’
\t14: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:70:in `times’
\t13: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:71:in `block in start’
\t12: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:71:in `fork’
\t11: from /Users/webmstk/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/testing/parallelization.rb:91:in `block (2 levels) in start’
\t10: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1138:in `method_missing’
\t 9: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1158:in `with_friend’
\t 8: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1139:in `block in method_missing’
\t 7: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1213:in `open’
\t 6: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1213:in `synchronize’
\t 5: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1216:in `block in open’
\t 4: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1216:in `each’
\t 3: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1218:in `block (2 levels) in open’
\t 2: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1262:in `alive?’
\t 1: from /Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1005:in `alive?’
/Users/webmstk/.rvm/rubies/ruby-2.6.2/lib/ruby/2.6.0/drb/drb.rb:1005:in `wait_readable’: Bad file descriptor (Errno::EBADF)

My “bin/rails about”:

➜ depot git:(master) ✗ bin/rails about
About your application’s environment
Rails version 6.0.0.rc1
Ruby version ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-darwin18]
RubyGems version 3.0.4
Rack version 2.0.7
Middleware Webpacker::DevServerProxy, ActionDispatch::HostAuthorization, Rack::Sendfile, ActionDispatch::Static, ActionDispatch::Executor, ActiveSupport::Cache::Strategy::LocalCache::Middleware, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, ActionDispatch::RemoteIp, Sprockets::Rails::QuietAssets, Rails::Rack::Logger, ActionDispatch::ShowExceptions, WebConsole::Middleware, ActionDispatch::DebugExceptions, ActionDispatch::ActionableExceptions, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::Migration::CheckPending, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ContentSecurityPolicy::Middleware, Rack::Head, Rack::ConditionalGet, Rack::ETag, Rack::TempfileReaper
Application root /Users/webmstk/study/rails/depot
Environment development
Database adapter mysql2
Database schema version 20190722103627

2019-11-15I can't reproduce this
10SUGGEST

“Since Mac OS X ships with Ruby 2.0.0” , By now lastest macOS Mojave(10.14.6), ships with Ruby 2.3.7p456 .

2019-10-02
51ERROR

In page 51 when it explains Regular Expressions and then on page 91 when one is used to validate the product model the match end of string, the character sequence provided is \\Z instead of \\z. \\Z is shorthand for \
?\\z

2019-10-02
91ERROR

The validation on page 91 for the image url uses \\Z in the regular expression. This will allow a trailing newline to match the file string.

In the product test on page 94 if you add “fred.gif\
” to the array of bad strings for image_urls, the test will fail with \\Z and pass with \\z on your validation. Since you are using a file name, it would make sense to use \\z instead of \\Z.

2019-10-02
115TYPO

Screenshot for page 115 Iteration C3: Using a Helper to Format the Price. The screenshot is cropped so that the change just made with the number_to_currency() helper is not visible.

2019-10-17
228SUGGEST

In rails6/depot_qb/app/models/order.rb example, we “require ‘pago’ but it seems that Rails isn’t set up to autoload files in the `lib folder. I think we need to add ”rails6/depot_qb/app/models/order.rb" in config/application.rb.

Also, using ActiveModel::Serializers::Xml is not mention at any point before this code sample in the book, so perhaps should be removed or explained at some point earlier.

2019-11-16I cannot reproduce the require issue. \n \nThe XML issue is dealt with by another errata so we won't forget that one.
437ERROR

Not really a technical error nor a typo bu you have the following sentence:- “In Part II, you iteratively built an application, built up test cases along the
way, and ultimately deployed it using Capistrano.”
However part 2 did not cover Capistrano deployment. Indeed deployment seems to be sadly missing completely.

2019-10-17
178TYPO

The book shows the command for updating the line_item table as:
bin/rails generate migration add_order_to_line_item order:references

Then it shows the output of the migration as :
AddOrderIdToLineItem: migrating
— add_column(:line_items, :order_id, :integer)

The migration class name doesn’t match the name of the migration in the command, and the output doesn’t match the output for the migration command given.

2019-10-03
137ERROR

Trying to download the images from media.pragprog.com/titles/rails6/code/rails6/depot_a/app/assets/images/ gives a 403.

2019-10-03
128OK

Using the params to button_to as stated on this page was insufficient for me. When I tried to add an item to my cart, I got a complaint that I didn’t have the required line_items param. My solution for this was to put the product_id hash inside of another hash with a line_item key so that it matched the generated strong params for the line_items controller. (I feel like I may have done something wrong here to have obtained this error in the first place, but I’m not sure what.)

2019-11-15Can't reproduce.
162SUGGEST

“Both filenames are treated as a template, executed in Ruby, and sent to the browser as JavaScript for execution. Using .js.erb means you want to write a JavaScript template, and .js.erb means you want to write an ERB template.”

This is confusing. Both filenames? What/which filenames are you referring to?

.js.erb => Javascript template, and
.js.erb => ERB template

There has to be a cleaner way to express this as I really don’t know what you’re trying to say.

And thanks to the guy that posted the correction on page 163. That problem had me scratching my head!

2019-10-03
277269TYPO

“Note that we want this tag to appear after the call to javascript_include_tag() so
that I18n will have been defined.”

The code samples use “javascript_pack_tag”

2019-10-03
277269TYPO

The rails6/depot_t/app/javascript/PayTypeSelector/index.jsx code snippet is missing the arrows where new code has been added for I18n calls

2019-11-16
132TYPO

Screenshot incorrect. A previous commenter noted that it is missing the flash notice, but it is also displaying the wrong route. It should be Your Pragmatic Cart instead of Your Pragmatic Catalog.

2019-11-15This appears to have been fixed in the current beta
27ERROR

The “brew install chromedriver” has changed. From “brew search chromedriver”:

If you meant “chromedriver” specifically:
It was migrated from homebrew/core to homebrew/cask.
You can access it again by running:
brew tap homebrew/cask
And then you can install it by running:
brew cask install chromedriver

2019-10-03
206OK

Missing gem! After the installation of react (going from depot_p to depo_pa) I had to install the gem “activemodel-serializers-xml”, since I got an error that the file was missing.
I use ruby2.6.3 and rails6.0.0.

2019-11-15I can't reproduce
159TYPO

Screenshot main nav background (excluding the cart) and letters are inverse from style at this point in the book. Main nav should be dark green background (#141) with light text.

2019-11-15This appears to have been fixed since the last beta
170ERROR

Same issue as noted on 163 where var should be used instead of let or it won’t work the second time. (If this wasn’t fixed in the 10/3/19 fix).

2019-10-17
170SUGGEST

Comments // START HIGHLIGHT and // END HIGHLIGHT don’t actually match the functionality/purpose of the code between the comments, which is to hide the notice.

2019-10-17
173ERROR

At the point when you implement the received(data) method of the products_channel.js you have pages other than store#index. If you are visiting any page other than the root URL when when somebody updates a product, your document content will be replaced with the store/index HTML, which is not a good experience if you have another window open in the app. If it’s not something you want to cover in the main chapter, you could add it to playtime.

The solution I have below is far from elegant, but solved the problem for now (fragile if you ever add other classes to that element):

let mainElement = document.getElementsByTagName(“main”)[0];
if (mainElement.className == ‘store’) {
mainElement.innerHTML = data.html;
}

2019-11-16
163ERROR

In create.js.erb we declare a variable with let. When the “Add to cart” button is clicked, it only updates the cart once. If we click it multiple times we receive an error “Uncaught SyntaxError: Identifier ‘cart’ has already been declared” in the browser console. We can fix this by declaring the variable cart with var instead of let.

2019-11-16
180TYPO

This could be a typo:
“Fortunately, Rails generated an outline of what you need to do in
app/assets/javascripts/channels/product_channel.js. …”

Later in the page the file path is correct but the file name turns plural :
“[0] and replace its HTML with the received HTML, like so:
rails6/depot_o/app/javascript/channels/products_channel.js”

2019-11-15
163ERROR

Hello,
I have found an error on the iteration f2, especifically on the ‘create.js.erb’ file. It is said in the book to declare a javascript variable in the file but doing so the button to add products to the cart breaks. After some debugging i’ve found that if the declarations of the variable is envolved in a try catch block, this erros is treated correctly.

example:
//…
try {
let cart = document.getElementById(“cart”);
} catch(e) {
cart = document.getElementById(“cart”);
}
//…

I hope this will be usefull to the next editions of the book.

2019-11-16
215SUGGEST

Strange sentence in line3. Should it not be: … the object of that function - which..
Maybe I don’t understand it?

2019-11-15
226SUGGEST

According your own code examples should line 2 not be:
Rails.application.configure block

2019-11-15
177ERROR

Migration error
According to the example code in rails6/depot_o/db/migrate/20190425000008_add_order_id_to_line_item file
$ bin/rails generate migration add_order_id_to_line_item order_id:integer
should be called instead of
$ bin/rails generate migration add_order_to_line_item order:references

2019-11-15I cannot reproduce this
206ERROR

Again about this missing gem. Sam Ruby wrote: can’t reproduce. But I found the gem “activemodel-serializers-xml” is just in the Gemfile of depot_pa. I was following the book and it is nowhere mentioned this gem should be added. I refer to the issue #85720 pdf page 228

2019-11-16
44SUGGEST

In the section for the Mac install, a few suggestions to consider…

Catalina has changed from bash to zsh so the echo commands to .bash_profile is not correct if the user is using zsh. This book appears to be usable by very new fresh users. New users to Mac will get zsh on Catalina. Existing users will stay with bash unless they decide to change. Anyhow… its a complication that you might want to think about.

Also, after the “rbenv global 2.6.5” command, the path might need to be rehashed. I actually don’t know the best way to do this with zsh. I used “hash -rf” but there may be a better way. With bash, I believe “hash ruby” will work. Again, for very inexperience users, this could trip them up and frustrate them.

2019-11-16
234SUGGEST

models/order.rb works fine without:
require ‘active_model/se…..’
and
include ActiveModel::Se…….
See also #85720 B1.0 page 228

2019-11-16
219TYPO

Working with depot_t and trying to pay with “Credit Card” and “Purchase Order” it appeared that the paytype_params in the charge! method models/order.rb were nil.
This is due to the fact there are typo’s in orders_controller.rb
In def paytype_params it should be be “Credit card” instead of “Credit Card”, also “Purchase order” instead of “Purchase Order”

2019-11-16
285ERROR

In order to make locale_switch.js effective you have to add <%= javascript_pack_tag(‘locale_switcher’) %>
to the end of the following files in vieuws:
store/index.html.erb
orders/_form.index.html.erb
line_items/index.html.erb and so on

In fact you must do it to all the sub-pages yielded in main in application.html.erb. Maybe there is a simpler way. I don’t see it.

2019-11-16
123TYPO

Oh dear… this is really confusing.

At the end of Iteration C1, there is a screen shot of the store index.

The screen shot in the PDF is correct and shows Chatbot, Docker, and Crystal. The same screen shot in my epub is wrong and appears to have seeds from depot_ua.

2019-11-16
295289TYPO

Charter17 should be“Task L,Iteration L1 ,IterationL2 ,IterationL3” ,not J used at Charter15

2019-11-15
182SUGGEST

After the change to the stylesheet in Iteration F3, the page must be reloaded to get the highlight to work. Just clicking the Add Cart didn’t work.

2019-11-15
188TYPO

The book has: “Fortunately, Rails generated an outline of what you need to do in app/assets/javascripts/channels/product_channel.js.”

The “/assets” directory is not correct. The path (as stated later on) is just “app/javascript/channels/products_channel.js”

2019-11-15
189SUGGEST

This is for the end of Iteration F5. When the products are updated and broadcast, they are in a different order so instead of just the price changing, they are all redrawn and in a different order. The @products = … statement (I guess) needs to sort them in the same way as the store#index method does but that sorta sucks.

2019-11-16
20SUGGEST

The suggestion of using a virtual machine is not flushed out well enough. I did not want to install Chrome and it is needed by ChromeDriver. That dependency is not mentioned.

There is a chance that I can use Brave which I’m about to explore but rather than do that, I thought it would be simple to switch to a virtual machine. But the rails-dev-box has the same problem. Not only is Chrome not installed but there is no X server or desktop configured.

Also, there seems to be an assumption that the virtual machine will be used on Linux but that isn’t really true.

I would suggest at least outlining the requirement for Chrome (or perhaps Brave) before ChromeDriver can be used. And I would outline the limitations and assumptions of the rails-dev-box path.

2019-11-17We've combined the virtual machine and linux setup and updated it so that it works. We aren't going to put anything about avoiding Chrome as that is not super common and not a use-case Rails supports. I understand not wanting Google in your life, but Rails system tests are designed to use chrome and chromedriver, so that's what the book will cover.
230SUGGEST

I got the test:system to pass. In my repo, I had test/system/carts_test.rb which was created during D1 as well as test/system/line_items_test.rb which was created during Iteration D2. These had tests that would not pass. I commented out the tests. The repo under depot_q did not have these files.

Also, if anyone cares, I got the ChromeDriver to work with Brave (on a Mac). I did this by creating a file config/initializers/webdrivers.rb with two lines:

Webdrivers::Chromedriver.required_version = ‘78.0.3904.70’
Selenium::WebDriver::Chrome.path = ‘/Applications/Brave Browser.app/Contents/MacOS/Brave Browser’

To find the first value, start Brave, do “About” and look at the “Chromium” version. Then go to this page chromedriver.storage.googleapis.com/index.html and find the version that is the closet match. Only the first two or three pieces matter. In my case, I matched the first three pieces. Put the string (version) from the web site as the value for required_version.

This way, you don’t need to subject your Mac to the abuses of Google.

2019-11-17
52TYPO

We constructed a toy application….

it should be demo not a toy application.

2019-11-15We are OK with calling it a "toy application"
11SUGGEST

The macOS installation instructions currently assume bash as the default shell, but in macOS 10.15 that default has been changed to zsh. As such, the book should probably also include instructions on how to set up rbenv with zsh.

2019-11-16
245ERROR

On page 245 of the PDF when formatting the user form you state "To improve the appearance of the page, we add and

tags." when in fact the code you show does not do this at all
Suggest either removing that statement or add the code?

2019-11-17
226ERROR

On pages 226 and 227 of the PDF when configuring email you refer to some code that does not exist in the various environments as follows

Depot::Application.configure do

This should read

Rails.application.configure

I’m sure I have reported this before on previous versions of the PDF

2020-01-03This looks fixed in the latest beta
226219ERROR

The if tests in pay_type_params method use “Credit Card” and “Purchase Order” (2nd word is capitalized). But everywhere else in the code, it is “Credit card” and “Purchase order” (2nd word is all lower case). I’ve just started tracking all this down. I’m not sure why the tests are passing. But when I got to the Active Job (Iteration I2), this line:

month,year = pay_type_params[:expiration_date].split(//)

was failing because the hash was empty because none of the if conditions were firing because pay_type was “Credit card” but the test was for “Credit Card”.

2020-01-03
54ERROR

The book show a Hash containing instruments:

inst_section = {
cello: :string,
clarinet: :woodwind,
drum: :percussion,
oboe: :woodwind,
trumpet: :brass,
violin: :string
}

It then shows how to access the values for some keys:

inst_section[:oboe] #=> ‘woodwind’

The hash rocket notation for the return value should be # => :woodwind, i.e. a Symbol, not a String.

2020-01-03
488SUGGEST

Page 488 in my epub (on MacOS). In Iteration K1, the root route changed and added a “via: :all” which is not explained in the text.

Also, somewhere in Iteration J2, bin/rails test:system started to fail in the users system test.

2020-01-03
285ERROR

I don’t know how it should be done but to get locale_switcher to not show the submit button, I did:

<%= javascript_pack_tag ‘application’, ‘locale_switcher’, ‘data-turbolinks-track’: ‘reload’ %>

in app/views/layouts/application.html.erb. Something seems to be broken because the documentation says javascript_pack_tag “By default,
this list is auto-generated to match everything in
app/javascript/packs/*.js.” … but that doesn’t seem to be happening.

2020-01-03
300SUGGEST

Chapter 17, end of Iteration 1, this might be obvious to everyone but me but the “from” field in the test email that you are sending needs to match the route that was created: support@example.com

Otherwise you get a routing error and a big ugly stack trace.

2020-01-03
xiTYPO

Some words seem to be missing in the 5th paragraph after “Rails 6le“:

“This book covers Rails 6le some of the commands you’ll be using are new, the underlying development model remains the same.“

2020-01-03
189ERROR

In the code sample for the LineItem class, :order and :product are being marked as optional, and :cart as required.

This should be :order and :cart as optional, and :product as required.

2020-01-03
128TYPO

The screenshot on this page shows the content of the webpage without any of the styles applied.

2020-01-03I'm not able to see this. On the 128th page of the PDF is a screenshot showing the result of the Rails scaffold which is intentionally unstyled. On the page with the pager number 128 there is no screenshot.
252ERROR

System tests in chapter15 gives a lot of errors

in test_helper.rb:
class ActionDispatch::IntegrationTest
must be
class ActionDispatch::SystemTestCase

in users_test.rb must be added to setup do:

login_as @user
(users_test.rb is nowhere mentioned!)

‘Password Confirmation’
must be
‘Confirm’

also you must not use @user In de Create user test
you will get the error: username already used
use ‘another name’
Could still not solve error in Destroy_test

in orders_test :
‘Pay type’
must be
‘Pay with’

Furthermore I get errors in paytype check in orders_test, not solved yet
Maybe someone else?

2020-01-03Some of this can be dealt with by using the same setup method as we did for the functional tests. I've updated the text in the book to reflect this. The users_test.rb is still broken because that was scaffolded. I've updated the book to call this out and leave it as an exercise (sorry it's too late in the production process to fix it more directly).
252ERROR

Merry Christmas! Yet forgotten in /system/users_test.rb in create, update and destroy
assert_texts must be:
‘was suscessfully created’, ‘was successfully updated’ and ‘deleted’

2020-01-03
287ERROR

“Task M: Receive Emails and Respond with Rich Text” follows “Task K: Internationalization.”
Did you intentionally leave out “Task L: Deployment and Production” that existed in previous versions?
Regardless, Task L should follow Task K, and not Task M.

2020-01-03
326SUGGEST

It seems nobody ever looked at chapter 19 (Active record) since edition Rails 4.
pay_type is integer, no varchar. This was changed already in edition 5
Output of several commands is changed. Table on page 3 stiil speaking of Fixnum, and so on!!
Writer should rewrite whole chapter.

2020-01-08All references to Fixnum have been removed, approximately six references to pay_type as an string were updated (and pay_type is now used as an example of the before_type_cast being different). Command outputs have been updated.
433TYPO

bin/rails generate spec:model Cart
should be:
bin/rails generate rspec:model Cart

14SUGGEST

You install google-chrome-stable without a specified version, but for chrome driver, you use version 2.41, so I think they could be incompatible. (The version is 79 for me at 2020/01/30)
I think you can guide people to check the version of Chrome installed then find the compatible version of driver themselves.

4ERROR

Chapter 1 - Installing Rails
Section: Installing on Windows

Text indicates Ruby 2.6.0 but graphic indicates Ruby 2.3.3.

5ERROR

This entire section needs to be updated. The Windows installer now includes the MSYS2 installation as as final step and the commands in the PDF book are no longer needed. Also, there’s no need to override the extract destination as suggested by the PDF book. Feel free to contact me: r_scott.shaffer@comcast.net for help with installing on Windows.

9ERROR

After installing rbenv, running ruby -v returns an error ‘ruby is not installed’

Fix: run rbenv rehash

179ERROR

After the form example, the paragraph states: “the first argument, module:order…”

fix: should be model

185ERROR

In the line_item model code the arrows showing the lines to modify are on the wrong lines.

Fix: They should be on the first and the third lines.

200ERROR

In the pay_type.jsx file the PayTypeSelector import does not work

fix: Add ‘./’ in front: import PayTypeSelector from ‘./PayTypeSelector’

213ERROR

Failed to find chrome binary when running “rails test:system”

fix: Install chrome

280ERROR

In application.html.erb, the form defaults to POST which breaks.

fix: Add explicit method: :get to form tag.

290TYPO

Instructions to use support@example.com as the “From” email

fix: should be the “To” email

431TYPO

command bin/rails generate spec:model Cart does not work

fix: should be bin/rails generate rspec:model Cart

317SUGGEST

Original text: They’re surprised that they call a model class Person and Rails somehow knows to go looking for a database table called people.

wouldn’t it be better to associate Person with the database table called persons?

147ERROR

the scss has an error: rails6/depot_i/app/assets/stylesheets/carts.scss

you sadly used th instead of td as selector two times.

its:
tfoot {
th, th.price {
font-weight: bold;
padding-top: 1em;
}
th {
text-align: right;
}
th.price {
border-top: solid thin;
}
}

should be :
tfoot {
th, td.price {
font-weight: bold;
padding-top: 1em;
}
th {
text-align: right;
}
td.price {
border-top: solid thin;
}
}

179TYPO

The paragraph right below the code snippet about form_with(), there is a typo in “The first argument, module: order tells the helper...", which should be "model: order”.

23TYPO

On p.23, it says “As the second line of the startup tracing indicates…”
Instead, it should say “As the second TO LAST line of the startup tracing indicates…”

183SUGGEST

The picture in page 183 shows the effects of the new styles added to carts.scss (in
rails6/depot_o/app/assets/stylesheets/carts.scss) without the text telling you to add them in. If you refresh your page at this point, your cart will have two dark green buttons without the seafoam green checkout button.

207TYPO

<select id=“pay_type”

Based on examples earlier (p. 202) and later (p. 208) this id should be “order_pay_type”.

To be fair, the book says “our code will look something like this” so it’s not telling the user to change it. Just makes sense to keep the examples consistent, other things being equal.

200ERROR

The ReactDOM.render(, element); line of code below creates errors in the Javascript console if you navigate away from the orders#new page.

document.addEventListener(‘turbolinks:load’, function() {
var element = document.getElementById(‘pay-type-component’);
ReactDOM.render(, element); // creates error in console if not in DOM
});

If you check for the presence of that element in the DOM before attempting to render, the errors go away:

document.addEventListener(‘turbolinks:load’, function() {
var element = document.getElementById(‘pay-type-component’);
if(element) {
// only attempt to render if element is present in the DOM
ReactDOM.render(, element);
}
});

22ERROR

In trying to launch the “Hello, Rails” application I keep running into the same issue when navigating to the “work” directory as instructed in the book. Error message reads: “Can’t initialize a new Rails application within the directory of another, please change to a non-Rails directory first.”

12ERROR

libreadline-dev is listed twice

364TYPO

resources :products, concern: :reviewable
resources :users, concern: :reviewable

should be

resources :products, concerns: :reviewable
resources :users, concerns: :reviewable

302ERROR

original text:
remembering to use support@example.com as the “From” email
correct text:
remembering to use support@example.com as the “To” email

298ERROR

original:

No associated order

Should be:

No associated order

155TYPO

"Note that we’ve given the

element that wraps the cart the CSS class carts." The element given the css class “carts” was a

tag. The

was not given a css class, and is not in the preceding code example. You find it back in the _cart.html.erb partial as a basic

tag.

167SUGGEST

The formatting for this code block is different than all others in the book. The erb <% %> tags have the brackets as light grey.

180TYPO

In the screenshot, an erb tag is mistakenly written as “<$= form_with”. It should be “<%= form_with”

212ERROR

It is suggested that ChromeDriver is a version of Chrome. It is not. It is used to automate Chrome.

397TYPO

“on page 167, we created such a helper method named hidden_div_if

This method was called render_if

109ERROR

In the pdf you state
first rename the application.css file to application.scss
Which is fine but you neglect to mention that you should NOT use require in scss files

According to the rails repository on github there is an important note in the documentation found at github rails sass-rails#important-note

Sprockets provides some directives that are placed inside of comments called require, require_tree, and require_self. DO NOT USE THEM IN YOUR SASS/SCSS FILES. They are very primitive and do not work well with Sass files. Instead, use Sass’s native @import directive which sass-rails has customized to integrate with the conventions of your Rails projects.

The book should be updated to fully describe the other actions needed when renaming the application.css to application.scss

Categories: