2013-02-21 54 views
3

我有这个文件app /资产/样式表/ config.rb具有以下内容:轨资产样式config.rb

http_path = "/" 
css_dir = "." 
sass_dir = "." 
images_dir = "img" 
javascripts_dir = "js" 
output_style = :compressed 
relative_assets=true 
line_comments = false 

又是什么呢?

+0

我注意到刚发生的应用程序中发生的同样的事情。该应用程序使用sass轨道,但不是指南针。我想知道是什么导致config.rb文件生成。 – 2013-03-04 17:51:05

+0

我和@WizardofOgz有完全相同的问题并想通了。我在下面回答了这两个问题。 – tehfoo 2013-03-07 18:48:38

回答

5

要回答你的问题“它是什么”,它是Compass scss编译器的配置。在对方的回答中引用是很方便,但最新的细节,而不会炒作退房指南针配置文件在这里的细节:

http://compass-style.org/help/tutorials/configuration-reference/

我原本张贴还提供了该文件的答案来自(如果你自己没有创建它,我回答这个是因为它在我的Rails项目中出现了“神奇”,并且在Rails中搜索生成config.rb的谷歌搜索结果在这里结束,我首先提到了sass-rails,但是那个项目的人证实他们没有生成那个文件,然后我发现这个文件的自动生成是由带有LiveReload包的Sublime Text造成的。请参阅相关的github issue

+1

非常棒!我永远不会想到崇高造成的问题。因为我的同事没有遇到这个问题,所以我疯了。 LiveReload软件包卸载后,一切恢复正常。修复程序发布后,我将重新安装该软件包。 – 2013-03-07 22:49:06

+1

是的,它也让我发疯。配置文件,我愿意让幻灯片,但当每次我救了15 foo.css文件开始弹出......这种事情让我超级不高兴。必须要做些事情。 – tehfoo 2013-03-09 19:01:33

0

我猜测它定义了如何从样式表文件夹中找到资产,以及在发送到客户端浏览器之前资产会发生什么的一些输出选项。

http_path = "/"    <= probably the root path to assets, so if you had 
           application.css, the URL path to it would be 
           http://example.com/application.css 
css_dir = "."    <= the directory to look for css files. "." in linux 
           means "the current directory", so this would set you 
           CSS path to app/assets/stylesheets 
sass_dir = "."    <= same as above, except for .sass/.scss files 
images_dir = "img"   <= images go in app/assets/stylesheets/img 
javascripts_dir = "js"  <= javascript go in app/assets/stylesheets/js 
           (seems like a strange place to put them) 
output_style = :compressed <= either to produce .gzip'ed versions of files 
           or to minify them, maybe both - consult docs on this 
relative_assets=true   <= relative, as opposed to absolute paths to assets, I think 
line_comments = false  <= I think this turns on/off the ability to include comments, 
           or maybe whether the comments are included in the 
           compressed versions of the file. turn it to "true" and 
           compare the assets, as served to the browser, and see 
           what the difference is 
+0

无需猜测,配置的参考位于Compass网站上:http://compass-style.org/help/tutorials/configuration-reference/ – tehfoo 2013-03-01 00:14:11

0

您可以通过从Sublime Text中删除Live Reload插件来修复它。

Sublime Text > Preferences > Package Control > Remove Package > Live Reload 

对我来说这是很好的解决方案,因为我没有使用Live Reload。 谁使用实时重新加载请按照问题:github