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 P1.0,
released about 1 year 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.
| PDF |
Paper |
Description |
Found in |
Fixed in |
| 3 |
|
#49968: I typed in the code for db_backup_initial.rb.
Your instructions say to run it like this:
db_backup_initial.rb
# => creates big_client_20110103.sql.gz
# => creates small_client_20110103.sql.gz
When I do that, I get this:
(master)⚡ [1] % ruby db_backup_initial.rb ~/Developer/git/db_backup/bin
sh: mysqldump: command not found
I'm sure this has something to do with the fact that I'm not using mysqldump and have never used it before, so I don't know if it is installed or not.
It would be good here to either make sure all the dependencies are intact, or, use another example that doesn't have extraneous dependencies.
I'm looking forward to reading this book and learning, but right now, I'm frustrated because the very first piece of code doesn't work.
Thanks.--Chris McNabb #49968: I typed in the code for db_backup_initial.rb.
Your instructions say to run it like this:
db_backup_initial.rb
# => creates big_client_20110 ...more...
|
P1.0
21-Oct-12
|
|
| 4 |
|
#49963: Hi.
"On UNIX systems, this is done via the first line of code, commonly referred to as the shebang. The shebang starts with a number sign (#), followed by an exclamation point (!), followed by the path to an interpreter that will be used to execute the program."
All other definitions I found, including the Wikipedia definition linked to below this text box, define the 'shebang' (#!) as the first two bytes only, not the entire first line of code. Your two sentences seem to expand it to include the path, etc that follow the shebang.
Hope this is helpful.
Thanks,
WB--William Bentley #49963: Hi.
"On UNIX systems, this is done via the first line of code, commonly referred to as the shebang. The shebang starts with a number sign ( ...more...
|
P1.0
19-Oct-12
|
|
| 20 |
|
#49980: Link to rdoc for OptionParser at the bottom of the page has changed to: ruby-doc.org/stdlib-1.9.3/libdoc/optparse/rdoc/OptionParser.html#method-i-make_switch --William Bentley #49980: Link to rdoc for OptionParser at the bottom of the page has changed to: ruby-doc.org/stdlib-1.9.3/libdoc/optparse/rdoc/OptionParser.html#metho ...more...
|
P1.0
23-Oct-12
|
|
| 20/36 |
|
#49982: The URL to the documentation of OptionParser#make_switch leads to a 404.
--Aljoscha Marcel Everding
|
P1.0
23-Oct-12
|
|
| 21 |
|
#48620: As currently foratted the following two items can be confusing. the '--blah' version has the dashes split across a line break which is a little hard to read.
=-=-=-=-=-
Flag with re- quired argument
"-v"
"--verbose"
"--[no-]verbose"
"-n NAME" or "- -name NAME"
-=-=-==--=--=-
Flag with option- al argument
"-n [NAME]" or "- -name [NAME]"--Robie #48620: As currently foratted the following two items can be confusing. the '--blah' version has the dashes split across a line break which is a littl ...more...
|
B5.0
31-Jan-12
|
|
| 22 |
|
#49981: Re the sample file media.pragprog.com/titles/dccar/code/be_easy_to_use/db_backup/bin/db_backup.rb
The sample file contains all three versions of the "-u USER" block.
Running with the second (ArgumentError) version produces the desired result.
Running with the third (regex as argument) version simply fails when the username is not formatted correctly. There is no error message.
I'm a bit of a Ruby noob, so I may be missing something obvious, but how can you supply an error message for validation failure?--William Bentley #49981: Re the sample file media.pragprog.com/titles/dccar/code/be_easy_to_use/db_backup/bin/db_backup.rb
The sample file contains all three versions ...more...
|
P1.0
23-Oct-12
|
|
| 26 |
|
#48980: The command 'gli scaffold to-do new list done' should read 'gli scaffold todo new list done'. If the command is entered as is, you see errors when you try to run subsequent commands.
--Chris Duncan #48980: The command 'gli scaffold to-do new list done' should read 'gli scaffold todo new list done'. If the command is entered as is, you see errors ...more...
|
P1.0
25-Mar-12
|
|
| 26 |
|
#50140: Not really a great nuisance, but it seems to me that it's hard to make this work on my system with a dash in the command name:
(00:10:46) jaws@Ferintosh:~/Dropbox/Devel$ ruby --version
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
(00:10:49) jaws@Ferintosh:~/Dropbox/Devel$ gli scaffold to-do kom gikk new list entry hours done
Creating dir ./to-do/lib...
Creating dir ./to-do/bin...
Creating dir ./to-do/test...
Created ./to-do/bin/to-do
Created ./to-do/README.rdoc
Created ./to-do/to-do.rdoc
Created ./to-do/to-do.gemspec
Created ./to-do/test/default_test.rb
Created ./to-do/test/test_helper.rb
Created ./to-do/Rakefile
Created ./to-do/Gemfile
Created ./to-do/features
Created ./to-do/lib/to-do/version.rb
Created ./to-do/lib/to-do.rb
(00:10:55) jaws@Ferintosh:~/Dropbox/Devel$ cd to-do/
(00:10:57) jaws@Ferintosh:~/Dropbox/Devel/to-do$ bin/to-do
bin/to-do:16: syntax error, unexpected keyword_do_block
version To-do::VERSION
^
(00:11:04) jaws@Ferintosh:~/Dropbox/Devel/to-do$ gli
NAME
gli - create scaffolding for a GLI-powered application
SYNOPSIS
gli [global options] command [command options] [arguments...]
VERSION
2.4.1
....
If I call the command/script todo instead of to-do, it works.--John Åsmund Westberg #50140: Not really a great nuisance, but it seems to me that it's hard to make this work on my system with a dash in the command name:
(00:10:46) j ...more...
|
P1.0
06-Nov-12
|
|
| 26 |
|
#48636: `gli scaffold to-do new list done` creates a to-do directory but the given example output and further example commands are sans hyphen.--Larry Marburger
|
B6.0
02-Feb-12
|
|
| 27 |
|
#49984: davetron5000.github.com/gli/classes/GLI.html leads to 404--Aljoscha Marcel Everding
|
P1.0
23-Oct-12
|
|
| 35 |
|
#48960: First paragraph underneath the code example: "That's all there is too it..."--Misty De Meo
|
P1.0
19-Mar-12
|
|
| 36 |
|
#50985: An easier approach is:
opts.banner += " database_name"
|
P1.0
08-Mar-13
|
|
|
41 |
#50627: In both the source code and the book, the line for the global option filename should be `flag [:f,:filename]` instead of just `flag :f`
The example of the book says that this should be displayed; "-f, --filename=todo_file - Path to the todo file (default: ~/.todo.txt)
" which can only happen if you include `flag [:f,:filename]`--Leonel Santos #50627: In both the source code and the book, the line for the global option filename should be `flag [:f,:filename]` instead of just `flag :f`
The ...more...
|
P1.0
31-Jan-13
|
|
| 41 |
|
#48637: I don't see where the documentation for the global -f flag is added. Back on page 28 the flag itself is added to the todo app and then on page 39 the help is printed and it's already listed. It's revised on this page (41), but I don't see where `desc` and `arg_name` were added to global `flag :f`.--Larry Marburger #48637: I don't see where the documentation for the global -f flag is added. Back on page 28 the flag itself is added to the todo app and then on page ...more...
|
B6.0
02-Feb-12
|
|
| 45 |
|
#50986: Type on the first line:
"My default..." should read "By default..."
|
P1.0
08-Mar-13
|
|
|
45 |
#49112: In doc-sample be_helpful/db_backup/man/db_backup.1.ronn, under section "## DESCRIPTION", second paragraph (top of page 45): "My default, `db_backup.rb' makes a daily backup..." should read "By default, ..."--Lorin Ricker #49112: In doc-sample be_helpful/db_backup/man/db_backup.1.ronn, under section "## DESCRIPTION", second paragraph (top of page 45): "My default, `db_ ...more...
|
P1.0
14-Apr-12
|
|
| 57 |
|
#48961: "Are there any standard error codeS?" sidebar - MacOS X, based as it is on FreeBSD, also includes the sysexits recommendations. Might be useful to mention for Mac developers.--Misty De Meo #48961: "Are there any standard error codeS?" sidebar - MacOS X, based as it is on FreeBSD, also includes the sysexits recommendations. Might be usefu ...more...
|
P1.0
19-Mar-12
|
|
| 58 |
|
#49518: if $?.exitstatus & 0b0002
Shouldn't that be: 0b0010 ?
--Eyðun Nielsen
|
P1.0
13-Jul-12
|
|
| 59 |
|
#48661: I'm writing a command line test wrapper that runs a test suite, does some other things and eventually needed to return the status of the tests suite in the form of a exit status. Page 59 shows how to exit with an error, but not simply exit with a designated return value (we don't want a backtrace or error message). I was able to get what I need by issuing exit! -1 which did not throw an error in ruby 1.9.2. Others may find this info useful. Thanks for writing this by the way ^_^--Richard Schneeman #48661: I'm writing a command line test wrapper that runs a test suite, does some other things and eventually needed to return the status of the tests ...more...
|
B6.0
05-Feb-12
|
|
| 66 |
|
#49096: On the example of Format Output One Record per Line, Delimiting Fields:
$ todo list
1,Clean kitchen,2011-06-03 13:45,
2,Rake leaves,2011-06-03 17:31,2011-06-03 18:34
3,Take out garbage,2011-06-02 15:48,
4,Clean bathroom,2011-06-01 12:00,
The out here does not have the complete_flag as indicated in the code:
play_well/todo/bin/todo
complete_flag = completed ? "C" : "U"
printf("%d,%s,%s,%s,%s\n",index,name,complete_flag,created,completed)
--Willie Tong #49096: On the example of Format Output One Record per Line, Delimiting Fields:
$ todo list
1,Clean kitchen,2011-06-03 13:45,
2,Rake leaves,2011-06 ...more...
|
P1.0
11-Apr-12
|
|
|
67 |
#50755: Last paragraph: "but there's a usability concern here" should be "but there's an usability concern here"--Leonel Santos
|
P1.0
06-Feb-13
|
|
| 73 |
|
#48968: First paragraph doesn't have a close parentheses. (See beginning of paragraph on previous page.)--Misty De Meo
|
P1.0
20-Mar-12
|
|
|
73 |
#50784: First paragraph "cronto" should be "cron to"
"The second line tells cronto run our" should be "The second line tells cron to run our" --Leonel Santos
|
P1.0
11-Feb-13
|
|
|
80 |
#49113: (Beneath the sidebar "ARGF:...", first paragraph: Missing period after "...standard input to the app)" before start of next sentence "In Ruby, the standard input is available via the constant STDIN."--Lorin Ricker #49113: (Beneath the sidebar "ARGF:...", first paragraph: Missing period after "...standard input to the app)" before start of next sentence "In Ruby, ...more...
|
P1.0
14-Apr-12
|
|
|
114 |
#49114: First sentence, first paragraph (after code example): "You can then view the RDoc be opening..." should read "You can then view the RDoc by opening..."--Lorin Ricker #49114: First sentence, first paragraph (after code example): "You can then view the RDoc be opening..." should read "You can then view the RDoc by op ...more...
|
P1.0
14-Apr-12
|
|
|
114 |
#49115: Last paragraph, second-to-last sentence: "This is a great alternative to hosing it yourself,..." should read "This is a great alternative to hosting it yourself..." [and may be the funniest typo in the whole book!]--Lorin Ricker #49115: Last paragraph, second-to-last sentence: "This is a great alternative to hosing it yourself,..." should read "This is a great alternative to h ...more...
|
P1.0
14-Apr-12
|
|
| 121 |
|
#48948: Code listings don't show the needed require 'aruba/cucumber' in env.rb--David Copeland
|
P1.0
15-Mar-12
|
|
| 144 |
|
#49151: 2nd paragraph from bottom. "An alterantive...", should be "alternative".--Aaron Renner
|
P1.0
19-Apr-12
|
|
| 165 |
|
#51253: "it allows you to execute arbitrary Ruby code, one command
and a time."
Should read "...at a time".
|
P1.0
08-Apr-13
|
|
| 2010 |
buMkw |
#48813: Very inireesttng! Chris mentioned this to me last week about my menu and it is something I will definately be looking at doing. It makes perfect SEO sense. --DIgqSIDnKPnwvO #48813: Very inireesttng! Chris mentioned this to me last week about my menu and it is something I will definately be looking at doing. It ...more...
|
B6.0
26-Feb-12
|
|