Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 带有Rails和Heroku的资产管道_Ruby On Rails_Heroku_Asset Pipeline - Fatal编程技术网

Ruby on rails 带有Rails和Heroku的资产管道

Ruby on rails 带有Rails和Heroku的资产管道,ruby-on-rails,heroku,asset-pipeline,Ruby On Rails,Heroku,Asset Pipeline,我无法解决生产环境的问题。heroku上的My application.css是空的,而在开发过程中,它很好 在my application.rb中,我添加了以下内容: config.assets.enabled=true config.assets.compress=false 但它仍然不起作用 预编译也不起作用。在我做了之后,heroku放了一条消息,说它已经找到了一个清单文件,但仍然没有工作。为了回滚它,我使用了rake资产:clean。消息仍然出现 我能做什么?我只有一个没有JS的CSS

我无法解决生产环境的问题。heroku上的My application.css是空的,而在开发过程中,它很好

在my application.rb中,我添加了以下内容:
config.assets.enabled=true
config.assets.compress=false
但它仍然不起作用

预编译也不起作用。在我做了之后,heroku放了一条消息,说它已经找到了一个清单文件,但仍然没有工作。为了回滚它,我使用了rake资产:clean。消息仍然出现

我能做什么?我只有一个没有JS的CSS文件

应用程序链接:

my Application.css的一部分:

/*
* This is a manifest file that'll be compiled into application.css, which will include all      the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require_tree .
*/

html, body, h1, h2, h3, h4, h5, h6, p, ul, li {
 margin: 0;
 padding: 0;
}

body {
 font-family: "Noto Sans", sans-serif;
}

请参阅以下网址:

如果在你的应用程序中检测到public/assets/manifest.yml,Heroku将 假设您自己正在处理资产编译,并且不会 尝试编译您的资产

您必须删除您的
manifest.yml
文件,以便Heroku管理您的资产或正确配置它。

请尝试以下操作

添加到文件:

gem“rails\u 12factor”,集团::生产

添加到/config/production.rb:

config.service\u static\u assets=true

config.action\u dispatch.x\u sendfile\u头='x-Accel-Redirect'

config.assets.compile=true


请参见

在这两种情况下,推到Heroku会向右移动,但浏览器无法获取文件。不幸的是,我尝试了文档中的所有内容,但样式仍然没有出现。。。在Heroku中是否有禁用链轮的方法?