BernardK

BernardK

Programming Ruby 3.2 (5th Edition): B4.0 many places, require "name" or require name

@noelrappin

Many places have require “name”, other require name. If you want to have the same style everywhere, the following pages are concerned :

+++++ NOT page 117, last paragraph, When you require BigDecimal, which is OK because require is in the normal font

+++++ page 253, first line after the green Info :

Now the gem is ready to be used, which means that any Ruby program can require rspec and
                                                                -----> ^^^^^^^^^^^^^

+++++ page 256, last paragraph, first and second to last line :

Alternately, inside your code, before you use any gems, you can require bundler/setup, which
                                                         -----> ^^^^^^^^^^^^^^^^^^^^^
...
exec code that also has a require bundler/setup that’s fine, the management work will only be
                   -----> ^^^^^^^^^^^^^^^^^^^^^

+++++ page 257, fourth paragraph from bottom, two first lines :

Be default, when you engage Bundler via Bundler.require or require bundler/setup each gem will
                                                    -----> ^^^^^^^^^^^^^^^^^^^^^
be autoloaded under the name of the gem. In other words, gem rspec implies require rspec.
                                                                    -----> ^^^^^^^^^^^^^

+++++ page 261, second paragraph, two times with mistake (bundle instead of bundler) :

`require': cannot load such file -- bundle/setup (LoadError)
Did you mean?  bundler/setup
`require': cannot load such file -- bundle (LoadError)
Did you mean?  bundler

Shoul be : … rather than require “bundler/setup”, you just require
“bundler”

+++++ page 292, first paragraph, lines 2-3 :

There is the jj method, which you need to require json to have access to, and which creates
                                   -----> ^^^^^^^^^^^^
pretty-printed JSON. It also has y, which comes when you require yaml and produces the
                                                  -----> ^^^^^^^^^^^^

+++++ page 293, second paragraph, lines 1 + 3 :

Alternately, you can use require debug/open in the background process, which allows you to
                  -----> ^^^^^^^^^^^^^^^^^^
the first line; if you want the program to run normally, use require debug/open_nonstop. How
                                                      -----> ^^^^^^^^^^^^^^^^^^^^^^^^^^

+++++ page 296, in Pry, fourth paragraph, lines 2-3 :

that with the same code we used for the debugger earlier, just replacing require debug with
                                                                  -----> ^^^^^^^^^^^^^
require pry and the binding.break call with binding.pry, we get this:
^^^^^^^^^^^ <-----

+++++ page 497, paragraph 3, line 3, already mentioned in a previous post
+++++ page 507, in BigDecimal, fourth paragraph from bottom, first line, as mentioned in the previous post

+++++ page 509, second to last paragraph, line 3 :

The formatter module, which gets mixed in with require random/formatter, gives you a set of
                                        -----> ^^^^^^^^^^^^^^^^^^^^^^^^

+++++ page 510, second paragraph after code, first line :

With the line require random/formatter, you get a number of useful methods mixed in to Random.
       -----> ^^^^^^^^^^^^^^^^^^^^^^^^

+++++ page 567, in FileUtils, second paragraph, first line :

To use these methods, you need to require fileutils. All the methods here are defined as module
                           -----> ^^^^^^^^^^^^^^^^^

+++++ page 639, last paragraph, lines 1-2 :

When using JRuby, you can import any Java library in your Java class path. If you add require
java to your file
^^^^ <----- "java"

First Post!

noelrappin

noelrappin

Author of Modern Front-End Development for Rails

This is a great catch and I very much appreciate it

Where Next?

Popular Pragmatic Bookshelf topics Top

belgoros
Following the steps described in Chapter 6 of the book, I’m stuck with running the migration as described on page 84: bundle exec sequel...
New
mikecargal
Title: Hands-On Rust (Chap 8 (Adding a Heads Up Display) It looks like ​.with_simple_console_no_bg​(SCREEN_WIDTH*2, SCREEN_HEIGHT*2...
New
Mmm
Hi, build fails on: bracket-lib = “~0.8.1” when running on Mac Mini M1 Rust version 1.5.0: Compiling winit v0.22.2 error[E0308]: mi...
New
JohnS
I can’t setup the Rails source code. This happens in a working directory containing multiple (postgres) Rails apps. With: ruby-3.0.0 s...
New
gilesdotcodes
In case this helps anyone, I’ve had issues setting up the rails source code. Here were the solutions: In Gemfile, change gem 'rails' t...
New
leba0495
Hello! Thanks for the great book. I was attempting the Trie (chap 17) exercises and for number 4 the solution provided for the autocorre...
New
adamwoolhether
When trying to generate the protobuf .go file, I receive this error: Unknown flag: --go_opt libprotoc 3.12.3 MacOS 11.3.1 Googling ...
New
AndyDavis3416
@noelrappin Running the webpack dev server, I receive the following warning: ERROR in tsconfig.json TS18003: No inputs were found in c...
New
adamwoolhether
I’m not quite sure what’s going on here, but I’m unable to have to containers successfully complete the Readiness/Liveness checks. I’m im...
New
taguniversalmachine
Hi, I am getting an error I cannot figure out on my test. I have what I think is the exact code from the book, other than I changed “us...
New

Other popular topics Top

AstonJ
What chair do you have while working… and why? Is there a ‘best’ type of chair or working position for developers?
New
malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
AstonJ
Do the test and post your score :nerd_face: :keyboard: If possible, please add info such as the keyboard you’re using, the layout (Qw...
New
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
New
AstonJ
If you are experiencing Rails console using 100% CPU on your dev machine, then updating your development and test gems might fix the issu...
New
PragmaticBookshelf
“A Mystical Experience” Hero’s Journey with Paolo Perrotta @nusco Ever wonder how authoring books compares to writing articles?...
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New
Fl4m3Ph03n1x
Background Lately I am in a quest to find a good quality TTS ai generation tool to run locally in order to create audio for some videos I...
New

Sub Categories: