Ruby on rails 链轮::CircularDependencyStore中出错#索引

Ruby on rails 链轮::CircularDependencyStore中出错#索引,ruby-on-rails,ruby,sprockets,Ruby On Rails,Ruby,Sprockets,我正在使用Rails第4版进行手动敏捷Web开发,我在Rails 3.1中遇到了一个链轮css问题。 代码css是: 如果我修改app/assets/stylesheets/aplication.css.scss的css代码,我会发现下一个错误: Sprockets::CircularDependencyError in Store#index Showing /home/ubuntu/Desktop/Depot/app/views/layouts/application.html.erb

我正在使用Rails第4版进行手动敏捷Web开发,我在Rails 3.1中遇到了一个链轮css问题。

代码css是:

如果我修改app/assets/stylesheets/aplication.css.scss的css代码,我会发现下一个错误:

Sprockets::CircularDependencyError in Store#index

Showing /home/ubuntu/Desktop/Depot/app/views/layouts/application.html.erb where line #5 raised:

/home/ubuntu/Desktop/Depot/app/assets/stylesheets/application.css.scss has already been required
Extracted source (around line #5):

2: <html>
3: <head>
4:   <title>Pragprog Books Online Store</title>
5: <%= stylesheet_link_tag "application" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tag %>
8: </head>
Rails.root: /home/ubuntu/Desktop/Depot

Application Trace | Framework Trace | Full Trace
app/views/layouts/application.html.erb:5:in`_app_views_layouts_application_html_erb___1008723970_81658620'
Sprockets::circulardependency存储区错误#索引
显示/home/ubuntu/Desktop/Depot/app/views/layouts/application.html.erb,其中第5行出现:
/home/ubuntu/Desktop/Depot/app/assets/stylesheets/application.css.scss已经是必需的了
提取的源(第5行附近):
2: 
三:
4:Pragprog图书在线商店
5: 
6: 
7: 
8: 
Rails.root:/home/ubuntu/Desktop/Depot
应用程序跟踪|框架跟踪|完整跟踪
app/views/layouts/application.html.erb:5:在“应用程序视图布局应用程序”中
我不明白为什么我会修改aplication.css.scss中的边距值或填充值,例如,我会得到这个错误


非常感谢。

您应该删除app/assets/stylesheets/application.css。

安装SCS后,我也遇到了同样的问题。我通过删除rails放在标题中的defult注释修复了这个问题。因此:

/*
 * 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 .
*/

#wrapper {
    width: 980px;
    margin: 0 auto;
}
变成这样:

#wrapper {
    width: 980px;
    margin: 0 auto;
}

我也有类似的问题:

当清单文件需要树文件时,就会发生循环依赖关系。Sass无论如何都会这样做,所以没有必要

删除:

 *= require_tree .

只需将application.css命名为“application.scss”。这将解决您的问题。

当您重新启动服务器时,它会消失吗?不会。我已重新启动服务器,但问题尚未解决。如果我取消激活css,页面将正常工作,但没有css。我已经从aplication.html.erb中删除了。然后页面运行良好,但没有css。我不知道我能做什么来解决这个问题:(.非常感谢。请提供一个可复制的示例。你能发布application.css文件的内容吗?为什么没有这样的文档记录?来自.NET这很让人困惑。我几乎要用谷歌搜索所有内容。:/Asset pipeline对很多人来说都很新,很让人困惑。它会变得更简单:)Greate yar,你节省了我很多时间。这解决了我的问题。谢谢。这叫做快速修复;)是的,
require\u树。
的意思是“需要此目录中的所有内容和所有子项”,并且在生成的
应用程序中。css
。非常奇怪的是,默认情况下Rails会说“始终在所有页面中包含所有CSS”,是吗?这些“默认注释”称为“指令”,如果没有它们,您将不得不显式地包含并预编译您的资产CSS文件。这对您来说可能还可以,但现在不是标准的Rails。正确。这是几年前,我有这个问题。我不在了,一切都按预期进行。我很确定我的问题是我当时做错了什么。