trying to deploy a simple Rails app as per fly directions - why am I getting errors?

I’m trying to deploy a couple pretty basic Rails apps to fly and I have run through some steps on here Getting Started · Fly Docs I got a simple Rails app up and deployed, but then when I get to here and do just a couple more steps Getting Started · Fly Docs , sometimes the page displays the Names text and sometimes it displays this:

"We’re sorry, but something went wrong.
If you are the application owner check the logs for more information. "

Then, if it does display Names, and I click on Names, it goes to this and the whole thing only displays this after that:

"We’re sorry, but something went wrong.
If you are the application owner check the logs for more information. "

Why would it be doing that? I have checked and double-checked the steps and the code. Any suggestions?

Greetings!

Let’s start with the contents of your log files. Run fly logs in your terminal, then click through the website. When you see the error message the logs should give you an error message. Paste that in here and we’ll figure out where to go from there.

There’s nothing to click through. I have tried multiple times to get the “Names” text and link to display again, but I have only seen it a couple of times. I just tried it again.

Right now, I’m only changing one line in the code. If I have the first line in the code, it deploys.
If I have the second line in the code instead, I get that error and the page just gives me an error. It does not load

Rails.application.routes.draw do

root “rails/welcome#index”

root "names#index"

end

These lines appeared in the log AFTER I got the first, working version deployed and AFTER I commented out the root “rails/welcome#index” line and replaced it with root “names#index” line and then I did this again after I changed that one line: fly deploy. Logged stuff after I changed that one line in the code and then ran fly deploy again:

2022-12-09T04:44:47.375 app[1de29083] yyz [info] I, [2022-12-09T04:44:47.375550 #531] INFO – : [a6d598ab-875a-407e-8827-c454956cb03c] Started GET “/” for 137.66.42.236 at 2022-12-09 04:44:47 +0000

2022-12-09T04:44:47.381 app[1de29083] yyz [info] I, [2022-12-09T04:44:47.380917 #531] INFO – : [a6d598ab-875a-407e-8827-c454956cb03c] Processing by NamesController#index as HTML

2022-12-09T04:44:47.425 app[1de29083] yyz [info] I, [2022-12-09T04:44:47.425453 #531] INFO – : [a6d598ab-875a-407e-8827-c454956cb03c] Rendered names/index.html.erb within layouts/application (Duration: 35.0ms | Allocations: 9449)

2022-12-09T04:44:47.425 app[1de29083] yyz [info] I, [2022-12-09T04:44:47.425625 #531] INFO – : [a6d598ab-875a-407e-8827-c454956cb03c] Rendered layout layouts/application.html.erb (Duration: 35.5ms | Allocations: 9511)

2022-12-09T04:44:47.426 app[1de29083] yyz [info] I, [2022-12-09T04:44:47.425975 #531] INFO – : [a6d598ab-875a-407e-8827-c454956cb03c] Completed 500 Internal Server Error in 45ms (ActiveRecord: 6.8ms | Allocations: 11740)

2022-12-09T04:44:47.427 app[1de29083] yyz [info] F, [2022-12-09T04:44:47.426913 #531] FATAL – : [a6d598ab-875a-407e-8827-c454956cb03c]

2022-12-09T04:44:47.427 app[1de29083] yyz [info] [a6d598ab-875a-407e-8827-c454956cb03c] ActionView::Template::Error (undefined local variable or method `new_name_path’ for #ActionView::Base:0x00000000007968):

2022-12-09T04:44:47.427 app[1de29083] yyz [info] [a6d598ab-875a-407e-8827-c454956cb03c] 24:

2022-12-09T04:44:47.427 app[1de29083] yyz [info] [a6d598ab-875a-407e-8827-c454956cb03c] 25:

2022-12-09T04:44:47.427 app[1de29083] yyz [info] [a6d598ab-875a-407e-8827-c454956cb03c] 26:

2022-12-09T04:44:47.427 app[1de29083] yyz [info] [a6d598ab-875a-407e-8827-c454956cb03c] 27: <%= link_to ‘New Name’, new_name_path %>

2022-12-09T04:44:47.427 app[1de29083] yyz [info] [a6d598ab-875a-407e-8827-c454956cb03c]

2022-12-09T04:44:47.427 app[1de29083] yyz [info] [a6d598ab-875a-407e-8827-c454956cb03c] app/views/names/index.html.erb:27

at a glance, I can see two things above.
Completed 500 Internal Server Error in 45ms
and
ActionView::Template::Error (undefined local variable or method `new_name_path’ for #ActionView::Base:0x00000000007968):

I have been following the directions exactly on your documentation. I was trying to get a simple Rails app working before I tried anything with my existing Rails apps. Maybe I should just try one of my existing Rails apps instead of trying to get this to work.

OK, this is truly weird. I just left it sitting there for a while, then just now, I refreshed the page and it’s suddenly working. Why?? The name text works. I was able to click on the links and they all work. I don’t get it. I mean, it’s nice that it’s working, just suddenly after sitting there for a while and then I refreshed the page.

OK, I found what it is. In the documentation, this line is not shown. I added it back again and then it didn’t work and later, I refreshed the page and now it works.
Suggestion: put this line back in the sample code on the page, so that it’s not missing. I thought I had tried this code with and without this line. The second line was missing in my code. It is NOT on the code written on your “how to” page, so I would suggest you put it back. I was getting errors, so I tried to copy what was there and I probably took out this line when I should not have (resources :names)
Rails.application.routes.draw do
resources :names