0

When using Rails for the first time (well, the first time in a few years) I came across a confounding error. When following the Getting Started turorial exactly, I got this error:

Error message: "No template for interactive request. ArticlesController#index is missing a template for request formats: text/html. NOTE! Unless told otherwise, Rails expects an action to render a template with the same name, contained in a folder named after its controller. If this controller is an API responding with 204 (No Content), which does not require a template, then this error will occur when trying to access it via browser, since we expect an HTML template to be rendered for such requests. If that's the case, carry on."

This persisted even when I deleted the project and tried again. However, after some searching online, I tried it in Command Prompt instead of Powershell, and voilà:

Text: "Hello, Rails!"

It's working now, but I'm confused about why it won't work on Powershell.

Edit: This was where I got the idea to try Command Prompt instead.

Isla
  • 85
  • 9
  • Please show the specific command you're using to start the server. – mklement0 Feb 06 '23 at 16:28
  • @mklment0 `ruby bin/rails server` – Isla Feb 06 '23 at 17:50
  • Assuming you've submitted the command from the _same_ directory in both cases, the call should work the same in PowerShell as it does in `cmd.exe`. Conceivably, your `cmd.exe` sessions have _environment variables_ defined that your PowerShell sessions don't, or perhaps the persistent environment variables were just changed (in the registry), and you haven't started a _new_ PowerShell session afterwards. – mklement0 Feb 06 '23 at 17:54

0 Answers0