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

Where Next?

Popular Pragmatic Bookshelf topics Top

iPaul
page 37 ANTLRInputStream input = new ANTLRInputStream(is); as of ANTLR 4 .8 should be: CharStream stream = CharStreams.fromStream(i...
New
jesse050717
Title: Web Development with Clojure, Third Edition, pg 116 Hi - I just started chapter 5 and I am stuck on page 116 while trying to star...
New
simonpeter
When I try the command to create a pair of migration files I get an error. user=&gt; (create-migration "guestbook") Execution error (Ill...
New
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
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
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
brunogirin
When installing Cards as an editable package, I get the following error: ERROR: File “setup.py” not found. Directory cannot be installe...
New
adamwoolhether
Is there any place where we can discuss the solutions to some of the exercises? I can figure most of them out, but am having trouble with...
New
ggerico
I got this error when executing the plot files on macOS Ventura 13.0.1 with Python 3.10.8 and matplotlib 3.6.1: programming_ML/code/03_...
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

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
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
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
PragmaticBookshelf
“Finding the Boundaries” Hero’s Journey with Noel Rappin @noelrappin Even when you’re ultimately right about what the future ho...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
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
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New

Latest in Agile Web Development with Rails 7

Agile Web Development with Rails 7 Portal

Sub Categories: