s2k

s2k

Author of Fast Feedback Using Ruby

Agile Web Development with Rails 7: Creating a new Rails app with '--css tailwind'

On (PDF) p. 68 the command to create the depot app is given as:

rails new depot --css tailwind

When I run this, I get an exception listed in the output:

/Users/stephan/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/yard-0.9.27/lib/yard/rubygems/hook.rb:88:in `require': cannot load such file -- yard (LoadError)
  …/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/yard-0.9.27/lib/yard/rubygems/hook.rb:88:in `load_yard'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/yard-0.9.27/lib/yard/rubygems/hook.rb:163:in `setup'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/yard-0.9.27/lib/yard/rubygems/hook.rb:152:in `generate'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/yard-0.9.27/lib/yard/rubygems/hook.rb:63:in `block in generation_hook'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/yard-0.9.27/lib/yard/rubygems/hook.rb:52:in `each'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/yard-0.9.27/lib/yard/rubygems/hook.rb:52:in `generation_hook'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/site_ruby/3.1.0/rubygems/request_set.rb:311:in `block in install_hooks'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/site_ruby/3.1.0/rubygems/request_set.rb:310:in `each'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/site_ruby/3.1.0/rubygems/request_set.rb:310:in `install_hooks'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/site_ruby/3.1.0/rubygems/request_set.rb:209:in `install'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/site_ruby/3.1.0/rubygems/commands/install_command.rb:210:in `install_gem'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/site_ruby/3.1.0/rubygems/commands/install_command.rb:226:in `block in install_gems'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/site_ruby/3.1.0/rubygems/commands/install_command.rb:219:in `each'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/site_ruby/3.1.0/rubygems/commands/install_command.rb:219:in `install_gems'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/site_ruby/3.1.0/rubygems/commands/install_command.rb:167:in `execute'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/site_ruby/3.1.0/rubygems/command.rb:323:in `invoke_with_build_args'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/site_ruby/3.1.0/rubygems/command_manager.rb:180:in `process_args'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/site_ruby/3.1.0/rubygems/command_manager.rb:149:in `run'
  …/.asdf/installs/ruby/3.1.0/lib/ruby/site_ruby/3.1.0/rubygems/gem_runner.rb:53:in `run'
  …/.asdf/installs/ruby/3.1.0/bin/gem:13:in `<main>'

And yet, the command ends in ‘Done in 234ms.’ with exit code 0.

The environment:

  • Ruby 3.1.0 installed with asdf
  • Rails 7.0.2
  • asdf 0.9.0
  • yard 0.9.27

So, calling yard from the command line directly works fine. It seems that the yard gem isn’t installed. In fact,

grep -in yar Gemfile

yields nothing and the exit code is 1.

Further observation: Creating a new Rails app without ‘–css tailwind’ doesn’t show this behaviour, i.e. it creates a new app without the exception.

Am I doing it wrong? Should the ‘–css tailwind’ cause ‘yard’ to be included in the Gemfile, but doesn’t?

Any input or help is appreciated.

Marked As Solved

s2k

s2k

Author of Fast Feedback Using Ruby

I figured (most of it) out: I had this in my .gemrc:

install: --rdoc --ri --document=yri
update: --rdoc --ri --document=yri

removing the --document=yri parts, also got rid of the exception.

Popular Prag Prog topics Top

HarryDeveloper
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
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
digitalbias
Title: Build a Weather Station with Elixir and Nerves: Problem connecting to Postgres with Grafana on (page 64) If you follow the defau...
New
dsmith42
Hey there, I’m enjoying this book and have learned a few things alredayd. However, in Chapter 4 I believe we are meant to see the “&gt;...
New
kolossal
Hi, I need some help, I’m new to rust and was learning through your book. but I got stuck at the last stage of distribution. Whenever I t...
New
jwandekoken
Book: Programming Phoenix LiveView, page 142 (157/378), file lib/pento_web/live/product_live/form_component.ex, in the function below: d...
New
EdBorn
Title: Agile Web Development with Rails 7: (page 70) I am running windows 11 pro with rails 7.0.3 and ruby 3.1.2p20 (2022-04-12 revision...
New
Keton
When running the program in chapter 8, “Implementing Combat”, the printout Health before attack was never printed so I assumed something ...
New
a.zampa
@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
dtonhofer
@parrt In the context of Chapter 4.3, the grammar Java.g4, meant to parse Java 6 compilation units, no longer passes ANTLR (currently 4....
New

Other popular topics Top

brentjanderson
Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
New
AstonJ
You might be thinking we should just ask who’s not using VSCode :joy: however there are some new additions in the space that might give V...
New
AstonJ
I have seen the keycaps I want - they are due for a group-buy this week but won’t be delivered until October next year!!! :rofl: The Ser...
New
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
AstonJ
If you want a quick and easy way to block any website on your Mac using Little Snitch simply… File &gt; New Rule: And select Deny, O...
New
New
AstonJ
Chris Seaton, the creator of TruffleRuby has died. It appears from suicide :cry: He left this note on Twitter on the weekend: And one...
New
PragmaticBookshelf
Author Spotlight: Tammy Coron @Paradox927 Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New