在开发模式下,Rails不会在Webrick上提供静态内容

问题描述 投票:0回答:1

我一直在尝试几乎所有方法来使Rails / Webrick在开发模式下提供html文件,但是我一直收到以下错误消息:

没有路由匹配[GET]“ /public/index.html”

即使在设置config.assets.enabled = true之后,也不会发生任何变化。 滑轨3.2.2

ruby-on-rails ruby-on-rails-3 webrick
1个回答
1
投票

从网站角度来看,公共目录是您的根目录。 例如:

/path_to_rails/public/index.html = http://localhost:3000/index.html
/path_to_rails/public/subdir/home.html = http://localhost:3000/subdir/home.html

假设您正在http://localhost:3000上运行本地开发服务器

© www.soinside.com 2019 - 2024. All rights reserved.