EdBorn

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 4491bb740a) [x64-mingw-ucrt]

First problem:
Running rails new depot --css tailwind provides an incomplete install and I get the following error:

Caused by:
TZInfo::DataSources::ZoneinfoDirectoryNotFound: None of the paths included in TZInfo::DataSources::ZoneinfoDataSource.search_path are valid zoneinfo directories.
C:/Users/edbor/Work/depot/config/environment.rb:5:in <main>' Tasks: TOP => app:template => environment (See full trace by running task with --trace) rails turbo:install stimulus:install You must either be running with node (package.json) or importmap-rails (config/importmap.rb) to use this gem. You must either be running with node (package.json) or importmap-rails (config/importmap.rb) to use this gem. rails tailwindcss:install rails aborted! TZInfo::DataSourceNotFound: tzinfo-data is not present. Please add gem 'tzinfo-data' to your Gemfile and run bundle install C:/Users/edbor/Work/depot/config/environment.rb:5:in

Caused by:
TZInfo::DataSources::ZoneinfoDirectoryNotFound: None of the paths included in TZInfo::DataSources::ZoneinfoDataSource.search_path are valid zoneinfo directories.
C:/Users/edbor/Work/depot/config/environment.rb:5:in `’
Tasks: TOP => app:template => environment
(See full trace by running task with --trace)

I have manually deleted ", platforms: %i[ mingw mswin x64_mingw jruby ] " from the manually installed gem file TZinfo-data in Depot to get it to run.
Then running:
C:\depot>rails generate scaffold Product title:string description:text image_url:string price:decimal
invoke active_record
create db/migrate/20220608005427_create_products.rb
create app/models/product.rb
invoke test_unit
create test/models/product_test.rb
create test/fixtures/products.yml
invoke resource_route
route resources :products
invoke scaffold_controller
create app/controllers/products_controller.rb
invoke tailwindcss
create app/views/products
create app/views/products/index.html.erb
create app/views/products/edit.html.erb
create app/views/products/show.html.erb
create app/views/products/new.html.erb
create app/views/products/_form.html.erb
create app/views/products/_product.html.erb
invoke resource_route
invoke test_unit
create test/controllers/products_controller_test.rb
create test/system/products_test.rb
invoke helper
create app/helpers/products_helper.rb
invoke test_unit
invoke jbuilder
create app/views/products/index.json.jbuilder
create app/views/products/show.json.jbuilder
create app/views/products/_product.json.jbuilder

I went to the migrate file and added: “, precision: 8, scale: 2” and the migrated the file with rails db:migrate.

I get to the following step:
“Windows users will need to run the command ruby bin/dev.”

Running ruby bin/dev provide the following error “ruby: no Ruby script found in input (LoadError)” There is no “dev” file in the bin folder. I know this has to be a simple error. Any help is appreciated.
Procfile.dev is there. Running Rails server and going to local host brings up riding the rails logo. Bring up the new product page show the product but it does not match the book. I think tailwind css is not in play. Any thoughts?

Thanks!

Ed

Marked As Solved

rubys

rubys

Author of Agile Web Development With Rails

Wow. I admire your perseverance. I encourage you to try WSL2. But to answer your question:

Your rails new did not complete. After it creates a bunch of files, it does a bundle install. After making a few changes, you managed to get past this point. The next steps it normally performs for you, but you can run yourself:

  • bundle binstubs bundler
  • bin/rails importmap:install
  • bin/rails turbo:install stimulus:install
  • bin/rails tailwindcss:install

Popular Prag Prog topics Top

abtin
page 20: … protoc command… I had to additionally run the following go get commands in order to be able to compile protobuf code using go...
New
New
jon
Some minor things in the paper edition that says “3 2020” on the title page verso, not mentioned in the book’s errata online: p. 186 But...
New
johnp
Running the examples in chapter 5 c under pytest 5.4.1 causes an AttributeError: ‘module’ object has no attribute ‘config’. In particula...
New
ianwillie
Hello Brian, I have some problems with running the code in your book. I like the style of the book very much and I have learnt a lot as...
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
oaklandgit
Hi, I completed chapter 6 but am getting the following error when running: thread 'main' panicked at 'Failed to load texture: IoError(O...
New
akraut
The markup used to display the uploaded image results in a Phoenix.LiveView.HTMLTokenizer.ParseError error. lib/pento_web/live/product_l...
New
bjnord
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
redconfetti
Docker-Machine became part of the Docker Toolbox, which was deprecated in 2020, long after Docker Desktop supported Docker Engine nativel...
New

Other popular topics Top

Exadra37
I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
New
AstonJ
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1117 25021 736
New
OvermindDL1
Woooooooo! This is such a huge release for it, and 2 years incoming! In short, the library is now using an updated hyper backend (not j...
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
First poster: joeb
The File System Access API with Origin Private File System. WebKit supports new API that makes it possible for web apps to create, open,...
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
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New