AufHe

AufHe

Agile Web Development with Rails 7: page 113 - Seeing the list of products

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

jimmykiang
This test is broken right out of the box… — FAIL: TestAgent (7.82s) agent_test.go:77: Error Trace: agent_test.go:77 agent_test.go:...
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
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
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
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
brunogirin
When running tox for the first time, I got the following error: ERROR: InterpreterNotFound: python3.10 I realised that I was running ...
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
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 prod...
New
Henrai
Hi, I’m working on the Chapter 8 of the book. After I add add the point_offset, I’m still able to see acne: In the image above, I re...
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

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
AstonJ
Or looking forward to? :nerd_face:
New
AstonJ
We have a thread about the keyboards we have, but what about nice keyboards we come across that we want? If you have seen any that look n...
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
Exadra37
Oh just spent so much time on this to discover now that RancherOS is in end of life but Rancher is refusing to mark the Github repo as su...
New
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
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
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
AstonJ
If you want a quick and easy way to block any website on your Mac using Little Snitch simply… File > New Rule: And select Deny, O...
New

Latest in PragProg

View all threads ❯