EdBorn

EdBorn

Agile Web Development with Rails 7: (page 70)

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

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
jamis
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
sdmoralesma
Title: Web Development with Clojure, Third Edition - migrations/create not working: p159 When I execute the command: user=&gt; (create-...
New
rmurray10127
Title: Intuitive Python: docker run… denied error (page 2) Attempted to run the docker command in both CLI and Powershell PS C:\Users\r...
New
jeremyhuiskamp
Title: Web Development with Clojure, Third Edition, vB17.0 (p9) The create table guestbook syntax suggested doesn’t seem to be accepted ...
New
curtosis
Running mix deps.get in the sensor_hub directory fails with the following error: ** (Mix) No SSH public keys found in ~/.ssh. An ssh aut...
New
jskubick
I’m running Android Studio “Arctic Fox” 2020.3.1 Patch 2, and I’m embarrassed to admit that I only made it to page 8 before running into ...
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
gorkaio
root_layout: {PentoWeb.LayoutView, :root}, This results in the following following error: no “root” html template defined for PentoWeb...
New
roadbike
From page 13: On Python 3.7, you can install the libraries with pip by running these commands inside a Python venv using Visual Studio ...
New

Other popular topics Top

AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
New
New
Exadra37
On modern versions of macOS, you simply can’t power on your computer, launch a text editor or eBook reader, and write or read, without a ...
New
Rainer
Not sure if following fits exactly this thread, or if we should have a hobby thread… For many years I’m designing and building model air...
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
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
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
PragmaticBookshelf
Author Spotlight: Sophie DeBenedetto @SophieDeBenedetto The days of the traditional request-response web application are long gone, b...
New
New

Latest in PragProg

View all threads ❯