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

brianokken
Many tasks_proj/tests directories exist in chapters 2, 3, 5 that have tests that use the custom markers smoke and get, which are not decl...
New
edruder
I thought that there might be interest in using the book with Rails 6.1 and Ruby 2.7.2. I’ll note what I needed to do differently here. ...
New
cro
I am working on the “Your Turn” for chapter one and building out the restart button talked about on page 27. It recommends looking into ...
New
leonW
I ran this command after installing the sample application: $ cards add do something --owner Brian And got a file not found error: Fil...
New
nicoatridge
Hi, I have just acquired Michael Fazio’s “Kotlin and Android Development” to learn about game programming for Android. I have a game in p...
New
taguniversalmachine
It seems the second code snippet is missing the code to set the current_user: current_user: Accounts.get_user_by_session_token(session["...
New
jonmac
The allprojects block listed on page 245 produces the following error when syncing gradle: “org.gradle.api.GradleScriptException: A prob...
New
SlowburnAZ
Getting an error when installing the dependencies at the start of this chapter: could not compile dependency :exla, "mix compile" failed...
New
dachristenson
I just bought this book to learn about Android development, and I’m already running into a major issue in Ch. 1, p. 20: “Update activity...
New
dachristenson
@mfazio23 Android Studio will not accept anything I do when trying to use the Transformations class, as described on pp. 140-141. Googl...
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
siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
DevotionGeo
I know that -t flag is used along with -i flag for getting an interactive shell. But I cannot digest what the man page for docker run com...
New
AstonJ
Just done a fresh install of macOS Big Sur and on installing Erlang I am getting: asdf install erlang 23.1.2 Configure failed. checking ...
New
Exadra37
I am a Linux user since 2012, more or less, and I always use Ubuntu on my computers, and my last 2 laptops have been used Thinkpads, wher...
New
Margaret
Hello content creators! Happy new year. What tech topics do you think will be the focus of 2021? My vote for one topic is ethics in tech...
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
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
PragmaticBookshelf
Author Spotlight Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New
PragmaticBookshelf
Author Spotlight: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New