Rails controller 和网页都生成了 但是就是无法访问

mistbow · January 30, 2013 · Last by southwolf replied at January 31, 2013 · 3027 hits

rails generate controller demo index 之后,使用浏览器进行访问:localhost/demo/index 返回网页 Not Found

请求这是怎么回事呢?controller index 等文件都生成出来啦。

请求如何查出问题的线索呢》感谢

httpd.conf 文件

ServerName app.com ServerAlias www.app.com DocumentRoot /var/www/html/blog/public

AllowOverride all Options -MultiViews

标签还不让显示。。。

rails server

then visit localhost:3000

#1 楼 @blacktulip 你好 我用的是 httpd 已经启动了 可以显示 rails 欢迎界面 但是就是进不去 demo/index

需要端口 localhost:3000/demo/index

#2 楼 @mistbow apache can't run rails apps directly. try use rails server to see what happens

#4 楼 @blacktulip 我使用了 passeger 那个模块了

#3 楼 @adventurelw 现在我的 httpd 的端口是 80 我就直接域名加/demo/index 了。但是访问不了

Please for once try rails server , so that we can know whether the problem is in your app or in the web server .

#7 楼 @blacktulip 我如果使用 rails s 那么 localhost:3000/demo/index 是可以访问的 那么应该说明我的 httpd 配置文件有问题 我贴下配置文件信息啊

#8 楼 @mistbow 不需要用 Apache 之类的东西,Rails 的开发环境执行 rails s 以后,就可以通过 http://127.0.0.1:3000 来访问了。

你先把 Rails 的东西搞明白了再去尝试 Passenger 或其他部署方式之类的东西吧,目前你可以安安心心的用 rails s 跑起来那个东西把 Rails 学会

@huacnlee 先用 webrick 跑通了再用其他的吧……

You need to Sign in before reply, if you don't have an account, please Sign up first.