简体   繁体   English

Rails Server,新文件不可用

[英]Rails Server, new files not live

在此处输入图片说明

I'm going through a Ruby on Rails tutorial and right now it's generating controllers. 我正在阅读Ruby on Rails教程,现在它正在生成控制器。 (I believe I'm on the local server.. started by doing: (我相信我在本地服务器上。

$rails s

When I look in TextMate, all the new files have a "no entry" sign on them, which I assume to be not live. 当我查看TextMate时,所有新文件上都带有“ no entry”符号,我认为这些符号不存在。 They also don't work when I try to pull up the address. 当我尝试提取地址时,它们也不起作用。 How do I make them live? 我如何使它们活着?

(Edit: Picture added, also.. When I try to go to the page it says: Routing Error (编辑:还添加了图片。。当我尝试转到页面时,它说:路由错误

No route matches [GET] "address" 没有路线与[GET]“地址”匹配

Try running rake routes for more information on available routes. 尝试运行耙路径,以获取有关可用路径的更多信息。

Rails should not be generating controllers . Rails不应生成控制器

My advise is to start all over 我的建议是从头开始

rails new myApp

cd myApp

rails generate scaffold Post name:string title:string content:text

rake db:migrate 

rails s 

At point your browser to http://localhost:3000 将您的浏览器指向http://localhost:3000

Then you'll see the rails welcome page 然后您会看到Rails欢迎页面

If you point the browser to http://localhost:3000/posts you'll get to the post index page 如果将浏览器指向http://localhost:3000/posts ,则将转到文章索引页面

And read this rails guide 并阅读此导轨指南

update 更新

Are you running rails generations from another user? 您是否正在运行其他用户的Rails代? It looks like you don't have read and write rights to the files from textmate. 看来您没有Textmate的文件读写权限。

Embarrassing lesson. 尴尬的教训。 The server was attached to a different directory. 服务器已附加到其他目录。 And apparently the symbol isn't read/write.. Not sure what it is though 而且显然该符号不是可读写的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM