Josh
Modern Front-End Development for Rails, Second Edition: can't get code to run
I just bought this book today and am having trouble getting the sample code running on an M1 MacBook.
I cd into chapter_01/02 do git init to save the initial state. Then I install Ruby 3.1.2 and run bundle install.
An error occurred while installing html_tokenizer (0.0.7), and Bundler cannot continue.
In Gemfile:
erb_lint was resolved to 0.1.1, which depends on
better_html was resolved to 1.0.16, which depends on
html_tokenizer
$ ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin24]
Here’s the error log:
current directory: /Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/html_tokenizer-0.0.7/ext/html_tokenizer_ext
/Users/username/.rbenv/versions/3.1.2/bin/ruby -I /Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0 -r ./siteconf20250429-32568-hbwjju.rb extconf.rb
creating Makefile
current directory: /Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/html_tokenizer-0.0.7/ext/html_tokenizer_ext
make DESTDIR\= clean
current directory: /Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/html_tokenizer-0.0.7/ext/html_tokenizer_ext
make DESTDIR\=
compiling html_tokenizer.c
compiling parser.c
parser.c:459:45: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
459 | INT2NUM(ref.line_number), INT2NUM(ref.column_number));
| ~~~~~~~ ~~~~^~~~~~~~~~~~~
parser.c:459:19: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
459 | INT2NUM(ref.line_number), INT2NUM(ref.column_number));
| ~~~~~~~ ~~~~^~~~~~~~~~~
parser.c:458:51: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
458 | INT2NUM(ref.mb_start), INT2NUM(ref.mb_start + mb_strlen),
| ~~~~~~~ ~~~~~~~~~~~~~^~~~~~~~~~~
parser.c:458:19: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
458 | INT2NUM(ref.mb_start), INT2NUM(ref.mb_start + mb_strlen),
| ~~~~~~~ ~~~~^~~~~~~~
parser.c:498:9: warning: unused variable 'old' [-Wunused-variable]
498 | void *old = parser->doc.data;
| ^~~
parser.c:721:26: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
721 | return INT2NUM(parser->errors_count);
| ~~~~~~~ ~~~~~~~~^~~~~~~~~~~~
parser.c:792:3: error: incompatible function pointer types passing 'VALUE (VALUE, VALUE)' (aka 'unsigned long (unsigned long, unsigned long)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types]
792 | rb_define_method(cParser, "errors", parser_errors_method, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/username/.rbenv/versions/3.1.2/include/ruby-3.1.0/ruby/internal/anyargs.h:287:135: note: expanded from macro 'rb_define_method'
287 | #define rb_define_method(klass, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_method((arity), (func))((klass), (mid), (func), (arity))
| ^~~~~~
/Users/username/.rbenv/versions/3.1.2/include/ruby-3.1.0/ruby/internal/anyargs.h:276:1: note: passing argument to parameter here
276 | RBIMPL_ANYARGS_DECL(rb_define_method, VALUE, const char *)
| ^
/Users/username/.rbenv/versions/3.1.2/include/ruby-3.1.0/ruby/internal/anyargs.h:254:72: note: expanded from macro 'RBIMPL_ANYARGS_DECL'
254 | RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _00(__VA_ARGS__, VALUE(*)(VALUE), int); \
| ^
6 warnings and 1 error generated.
make: *** [parser.o] Error 1
make failed, exit code 2
I spent almost an hour with Copilot trying to debug it, but still couldn’t get it to run. I updated some of the dependencies, but that just created other errors where it couldn’t find the Logger.
Has anyone been able to get the sample code working recently?
Popular Pragmatic Bookshelf topics
page 37
ANTLRInputStream input = new ANTLRInputStream(is);
as of ANTLR 4 .8 should be:
CharStream stream = CharStreams.fromStream(i...
New
The following is cross-posted from the original Ray Tracer Challenge forum, from a post by garfieldnate. I’m cross-posting it so that the...
New
Hi everyone!
There is an error on the page 71 in the book “Programming machine learning from coding to depp learning” P. Perrotta. You c...
New
Hi @venkats,
It has been mentioned in the description of ‘Supervisory Job’ title that 2 things as mentioned below result in the same eff...
New
The generated iex result below should list products instead of product for the metadata. (page 67)
iex> product = %Product{}
%Pento....
New
This isn’t directly about the book contents so maybe not the right forum…but in some of the code apps (e.g. turbo/06) it sends a TURBO_ST...
New
This is as much a suggestion as a question, as a note for others.
Locally the SGP30 wasn’t available, so I ordered a SGP40. On page 53, ...
New
Is the book’s epub format available to read on Google Play Books?
New
@mfazio23
I’m following the indications of the book and arriver ad chapter 10, but the app cannot be compiled due to an error in the Bas...
New
Hello @herbert ! Trying to get the very first “Hello, Bracket Terminal!" example to run (p. 53). I develop on an Amazon EC2 instance runn...
New
Other popular topics
Free and open source software is the default choice for the technologies that run our world, and it’s built and maintained by people like...
New
Write Elixir tests that you can be proud of. Dive into Elixir’s test philosophy and gain mastery over the terminology and concepts that u...
New
Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
New
From finance to artificial intelligence, genetic algorithms are a powerful tool with a wide array of applications. But you don't need an ...
New
There’s a whole world of custom keycaps out there that I didn’t know existed!
Check out all of our Keycaps threads here:
https://forum....
New
If you want a quick and easy way to block any website on your Mac using Little Snitch simply…
File > New Rule:
And select Deny, O...
New
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
Author Spotlight:
VM Brasseur
@vmbrasseur
We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New
Get the comprehensive, insider information you need for Rails 8 with the new edition of this award-winning classic.
Sam Ruby @rubys
...
New
Hair Salon Games for Girls Fun
Girls Hair Saloon game is mainly developed for kids. This game allows users to select virtual avatars to ...
New
Latest in Modern Front-End Development for Rails, Second Edition
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /python
- /js
- /rails
- /security
- /go
- /swift
- /vim
- /clojure
- /emacs
- /java
- /haskell
- /svelte
- /onivim
- /typescript
- /kotlin
- /c-plus-plus
- /crystal
- /tailwind
- /react
- /gleam
- /ocaml
- /elm
- /flutter
- /vscode
- /ash
- /html
- /opensuse
- /zig
- /deepseek
- /centos
- /php
- /scala
- /react-native
- /lisp
- /textmate
- /sublime-text
- /nixos
- /debian
- /agda
- /django
- /deno
- /kubuntu
- /arch-linux
- /nodejs
- /revery
- /ubuntu
- /manjaro
- /spring
- /diversity
- /lua
- /julia
- /markdown
- /slackware








