首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >为什么我得到了空白页?

为什么我得到了空白页?
EN

Stack Overflow用户
提问于 2015-03-21 16:47:50
回答 2查看 632关注 0票数 1

我在rails 4.2应用程序上,当我在浏览器中查看它时,我只得到空白页面,奇怪的是,所有的路由都可以工作,但它们都会得到空白页面,这是我得到的结果:

代码语言:javascript
运行
AI代码解释
复制
 <!DOCTYPE html>
<html>
<head>

  <link rel="stylesheet" media="all" href="https://d2m2v9ix6oa4mz.cloudfront.net/assets/application-5ea496b2544e770dd32eddc798ebe844.css" />
  <script src="https://d2m2v9ix6oa4mz.cloudfront.net/assets/application-2020c3d1d37b4e77942c8d4b54d4b790.js"></script>
  <meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token" content="PMSfAv88XZbAbSebUIfNCWS+aeesawxSz40C19iy1ze1ddR/htclFSd4CP/xkpAVR4hHUh1hVs3QkkOsHTQTVg==" />
</head>
<body>
  <style>
  .span7
  {
    width:550px;
  }
  .myContainer
  {
    width: 1050px;
    margin-right: auto;
    margin-left: auto
  }
  .h2{
    margin-left:100px;
  }
  .btn.jumbo {
  font-size: 21px;
  line-height: normal;
  padding: 9px 14px 9px;
  -webkit-border-radius: 6px;
  -moz-border-radius: 6px;
  border-radius: 6px;
  }
</style>



</body>
</html>

下面是我如何启动我的应用程序:

代码语言:javascript
运行
AI代码解释
复制
# rails s -e production
=> Booting WEBrick
=> Rails 4.2.0 application starting in production on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
DEPRECATION WARNING: The configuration option `config.serve_static_assets` has been renamed to `config.serve_static_files` to clarify its role (it merely enables serving everything in the `public` folder and is unrelated to the asset pipeline). The `serve_static_assets` alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in <top (required)> at /var/www/web.com/config/environments/production.rb:26)
[2015-03-21 16:36:31] INFO  WEBrick 1.3.1
[2015-03-21 16:36:31] INFO  ruby 2.2.1 (2015-02-26) [x86_64-linux]
[2015-03-21 16:36:31] INFO  WEBrick::HTTPServer#start: pid=24129 port=3000

如何知道发生了什么?有什么问题吗?!

EN

回答 2

Stack Overflow用户

发布于 2015-03-21 23:44:37

您可能需要编译您的资产。

运行:

代码语言:javascript
运行
AI代码解释
复制
RAILS_ENV=production bundle exec rake assets:precompile

在生产服务器上,试一试。

您可以在本地执行此操作,并将其推送到您的VPS。

票数 0
EN

Stack Overflow用户

发布于 2016-11-22 13:01:45

所以我不确定这是不是你的问题,但我也有同样的问题,结果是我注释了_header.html.erb文件中最后几行html代码,但没有关闭注释-->,因此它有效地注释掉了我页面上的所有代码,留下了一个空白页面。愚蠢的错误。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29185294

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档