Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 轨道';s localhost:“本地主机”;缺少“请求格式”的模板;?_Ruby On Rails - Fatal编程技术网

Ruby on rails 轨道';s localhost:“本地主机”;缺少“请求格式”的模板;?

Ruby on rails 轨道';s localhost:“本地主机”;缺少“请求格式”的模板;?,ruby-on-rails,Ruby On Rails,我是Ruby Rails的新手,我正试图通过这个Youtube指南创建一个Rails页面 https://www.youtube.com/watch?v=pPy0GQJLZUM 当我浏览页面时,我遇到了这个问题。当我试图打开localhost:localhost:3000时,它给了我这个通知 PostsController\index缺少请求格式的模板:text/html 在\app\views\posts中,我有这样一个index.html.erb文件 索引 在\app\controllers

我是Ruby Rails的新手,我正试图通过这个Youtube指南创建一个Rails页面

https://www.youtube.com/watch?v=pPy0GQJLZUM

当我浏览页面时,我遇到了这个问题。当我试图打开localhost:localhost:3000时,它给了我这个通知

PostsController\index缺少请求格式的模板:text/html

\app\views\posts
中,我有这样一个
index.html.erb
文件

索引

\app\controllers\posts\u controller.rb
中,我有这样的
posts\u controller.rb
文件

class PostsController

\config\routes.rb
中,我有如下
routes.rb
文件
Rails.application.routes.draw do
根“posts#index”
结束


我是个新手,对这个问题很困惑。你能帮帮我吗?非常感谢。

我很感谢你说你有一个,但是这个错误消息意味着
app/views/posts/index.html.erb
中没有文件-注意拼写错误和大写字母,正如你在视频中看到的那样,他们在
index.html.erb
文件中这样写道
index
,所以我遵循了他们,我错了吗?或者我需要更多的东西吗?正如马克所说,filname可能有问题,你能展示一下
应用程序/viers/posts
?亲爱的朋友们,谢谢你们的评论。正如马克先生所说,这只是因为我的拼写错误。非常感谢。通常是这样,不客气:)