AufHe

AufHe

I’m a newbie to Rails 7 and have hit an issue with the bin/Dev script mentioned on pages 112-113.

Iteration A1 - Seeing the list of products

I am using windows 10 but when I attempt to run the ruby bin/dev command described for windows users,I see the error:
Traceback (Most recent call last)
ruby: no Ruby script found in input

Has anyone else seen this?
Any suggestions on how I can move forward.

I am able to start the server on its own, but for some reason can’t get that bin/dev script to run.

Thanks

Marked As Solved

rubys

rubys

Author of Agile Web Development With Rails

Looks like that was reported on Rails 4. I see another report from two years ago: tzinfo-data issue when starting new rails project - Stack Overflow with Rails 5. Now you are seeing it with Rails 7.

So it is not just you, but clearly is is not affecting every Windows user. Debugging this remotely is not going to be easy. And there always is the concern that once you solve this problem that will only prepare you to get to the point where you encounter the next problem.

I’m going to describe two options, and I’m going to encourage the first option, as that is what I use myself and am very happy with it.

First option

Most Rails developers use MacOS machines. Most Rails apps are deployed on Linux. This makes these two the preferred environments for Rails.

Windows 10 and above can run something called WSL2, which gives you a pristine Linux install. If you are running Windows 11, you can install WSL2 from the App Store. Otherwise, open a command prompt as administrator and run wsl --install. Go with the default Linux distribution (currently Ubuntu 20.04).

I highly recommend both Windows Terminal (also from the App Store) and Visual Studio Code (from the App Store for Windows 11 users, installable from the web site for everybody else).

The end result is literally seamless - you can edit your files using VS Code, run commands via Windows Terminal, and access your server via Microsoft Edge browser as localhost.

And because it is a separate environment, it is not affected by things you may have installed in the past, and won’t affect things you may install in the future. And you are not installing things from a third party - everything I listed above is from Microsoft.

And if you have questions, I am here to help as I have this installed myself (as well as “native” windows and Mac OS/X).

Option 2

For reasons I don’t yet understand, Rails is producing a Gemfile that doesn’t work for you. So what we need to do is to stop the installation process in the middle, correct the Gemfile, and then complete the installation. And Rails provides an option to do exactly that:

rails new depot --skip-bundle

Correct the Gemfile per instructions you can find on Stack Overflow and other places. And then proceed with the rest of the installation:

bundle install
bundle add tailwindcss-rails
bundle binstubs bundler
ruby bin/rails importmap:install
ruby bin/rails turbo:install stimulus:install
ruby bin/rails tailwindcss:install

This should get you to the exact place you would be if Rails had generated a Gemfile that worked for you. If you get this to work, I would suggest opening an issue with Rails so that they can fix it for others, and I would appreciate it if you shared that information with me, here, so that I can update the book in a way that may benefit others.

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
johnp
Hi Brian, Looks like the api for tinydb has changed a little. Noticed while working on chapter 7 that the .purge() call to the db throws...
New
lirux
Hi Jamis, I think there’s an issue with a test on chapter 6. I own the ebook, version P1.0 Feb. 2019. This test doesn’t pass for me: ...
New
herminiotorres
Hi @Margaret , On page VII the book tells us the example and snippets will be all using Elixir version 1.11 But on page 3 almost the en...
New
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
swlaschin
The book has the same “Problem space/Solution space” diagram on page 18 as is on page 17. The correct Problem/Solution space diagrams ar...
New
fynn
This is as much a suggestion as a question, as a note for others. Locally the SGP30 wasn’t available, so I ordered a SGP40. On page 53, ...
New
brunogirin
When running tox for the first time, I got the following error: ERROR: InterpreterNotFound: python3.10 I realised that I was running ...
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
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

Other popular topics Top

malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New
DevotionGeo
I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New
AstonJ
I ended up cancelling my Moonlander order as I think it’s just going to be a bit too bulky for me. I think the Planck and the Preonic (o...
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
mafinar
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New
AstonJ
If you get Can't find emacs in your PATH when trying to install Doom Emacs on your Mac you… just… need to install Emacs first! :lol: bre...
New
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New