0

public/我在名为hello.html(例如)的文件夹中创建了一个新页面。

但是由于某种原因,每当我尝试访问它时,都会收到路由错误。

我的服务器给出的响应是..

Started GET "/hello.html" for 127.0.0.1 at 2012-03-04 17:39:29 +0000

ActionController::RoutingError (No route matches [GET] "/hello.html"):
  actionpack (3.2.2) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (3.2.2) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.2) lib/rails/rack/logger.rb:26:in `call_app'
  railties (3.2.2) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.2) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.1) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.2) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.1) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.2) lib/action_dispatch/middleware/static.rb:61:in `call'
  railties (3.2.2) lib/rails/engine.rb:479:in `call'
  railties (3.2.2) lib/rails/application.rb:220:in `call'
  rack (1.4.1) lib/rack/content_length.rb:14:in `call'
  railties (3.2.2) lib/rails/rack/log_tailer.rb:14:in `call'
  rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
  /Users/Keva161/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
  /Users/Keva161/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
  /Users/Keva161/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'


  Rendered /Users/Keva161/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.2/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (6.3ms)

我相信这是一个ActionController过于热心但不知道如何解决的问题。

有任何想法吗?

4

2 回答 2

0

Rails 不需要扩展。您应该能够通过简单地访问您的静态页面/hello

于 2012-03-04T18:35:54.213 回答
0

你在做什么。你在看错误的东西。

我刚刚克隆了您的存储库并运行了该应用程序:

~ curl "http://localhost:3000/hello.html"
<!DOCTYPE html>
<html>
<head>
    <title>Greetings!</title>
    <body>
        </body>
        <p>Hello World!</p>
    </head>
</html>%  
于 2012-03-04T18:56:17.557 回答