Errata

Sinatra: Up and Running

Errata for Sinatra: Up and Running

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
PDF Page 36
Example 2-27 output sample

Several of the output examples between pages 36 and 41 in the PDF version use port 9393 rather than port 4567, however there is no explicit instruction to use a port other than the default 4567.

phipster  Jun 11, 2013 
Other Digital Version 40
example 2.31

In the example, it has a "require uuid". However if you have a fresh install of ruby and sinatra, then you will have to explicitly load this gem...

ie gem install uuid.....(actually installs 3 gems in my environment, but YMMV), Anyway for a newbie this would be good advice to install this first before running the example.

Fetching: systemu-2.4.2.gem (100%)
Fetching: macaddr-1.5.0.gem (100%)
Fetching: uuid-2.3.5.gem (100%)

Sc0tt....

Scott Russell  Jan 28, 2012 
PDF Page 46
Example 2-37

The broadcast route uses a GET method in the example.This should be a POST.

The following curl example is also using a GET implicitly.

Volkan Edis  Dec 20, 2014 
Printed Page 57
Example 3-10

The case statement is missing the closing 'end'. Probably a c&p error because the same occured on pg. 56 and was already reported.
Great book though!

Steffen Roller  Jun 26, 2012 
Printed, PDF, Other Digital Version Page 61
Top of the page, 1st "Rack It Up" paragraph

>> What does all this mean for us as Sinatra developers? If you hop into IRB again and try typing Sinatra::Application.new.class, you will find that new does not return an in- stance of Sinatra::Application (give it a shot; it actually returns an instance of Rack::MethodOverride).

Sinatra::Application.new.class returns Sinatra::ShowExceptions not Rack::MethodOverride.

Peter Aronoff  Dec 06, 2011 
Other Digital Version 77
Example 4-8

GenarlApp.set:foo, 42 next line should read....

=> GeneralApp

Currently it reads MyApp

CustomApp.set :foo, 23 next line should read...

=> CustomApp

Scott Russell  Feb 04, 2012 
PDF Page 78
Example 4-20

In the pdf we have:

map "/#{word}" { run Sinatra.new { get('/') { word } } }


and it should be:

map("/#{word}") { run Sinatra.new { get('/') { word } } }

Without the parentheses we will have a syntax error.

Ismael Marin  Dec 10, 2011 
PDF Page 78
Example 4-2, inside words.each block

Not sure why, but ruby throws a syntax error with the map statement in the words.each block (ruby 1.9.2 or 3). Only way I could get code to run is by separating the map declaration blocks like so:

words.each do |word|
map "/#{word}" do
run Sinatra.new { get('/') { word }}
end
end

Craig Hess  Jun 27, 2012 
PDF, Other Digital Version Page 79
Example 4-22

Using Ruby 1.9.2 and Sinatra 1.3.1, the example for automatically capturing subclasses as middleware will overflow the stack on first request. I suspect this occurs because the subclasses inherit themselves as middleware from ApplicationController.

Matthew Nelson  Dec 08, 2011 
PDF Page 85
Example 4-34

In the MyApplication class,
helpers MyApplication
should be
helpers MyHelpers

Craig Hess  Jun 28, 2012 
85
Example 4-34. Using helpers in a modular application

On line 11 of the example, 'helpers MyApplication' should be 'helpers MyHelpers'

Anonymous  Oct 26, 2012 
ePub Page 85
Example 4-34

In the MyApplication class,
helpers MyApplication
should be
helpers MyHelpers

-- Repeat --
This is in the Kindle edition as well.

Carolyn Ann Grant  Nov 02, 2012 
Mobi Page 1755
Example 4-32, 4-33

both example not work.
It will work using 'Routes.run!' instead of 'run Routes',
but still 'Rack::Mount' not utilized.

Kyo Endo  Mar 12, 2013