我用谷歌搜索并阅读网页,直到我的眼睛流血,但仍然找不到答案。如果已经回答,请原谅我。
我的指南针项目咕噜声“编译”对生产和开发“模式”很好。当使用铬时,souremaps工作。但是,Chrome报告所有指南针库/核心文件的404错误。
以下是404s: http://i.stack.imgur.com/Kyqq6.jpg
我可以从源映射文件中看到问题所在,但不知道如何修复它。这是style.css.map文件:
{
"version": 3,
"mappings": "..snip-snip..",
"sources": ["../sass/_print.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/typography/_units.scss","../sass/components/_colors.scss","../sass/components/_fonts.scss","../sass/components/_header.scss","../sass/components/_misc.scss","../sass/_mixins.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/utilities/general/_clearfix.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/utilities/general/_hacks.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/css3/_images.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/typography/_vertical_rhythm.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/_support.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/css3/_text-shadow.scss","../sass/_init.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/css3/_transition.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/css3/_border-radius.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/css3/_appearance.scss","../sass/_normalize.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/css3/_box-sizing.scss","../sass/layouts/_fixed.scss","../sass-extensions/zen-grids/stylesheets/zen/_grids.scss","../sass/styles.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/css3/_box-shadow.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/css3/_transform.scss"],
"names": [],
"file": "styles.css"
}
因此所有“../../../ ..”在开发过程中都会导致404错误,这非常烦人。基本上罗盘生成的路径无效。
有谁知道如何让指南针表现,所以这不会发生?我假设我的config.rb中的设置是必要的,但我不知道哪一个:http://compass-style.org/help/documentation/configuration-reference/
这是我的config.rb:
#
# Change this to :production when ready to deploy the CSS to the live server.
#environment = :production
firesass = (environment == :development) ? true : false
css_dir = "css"
sass_dir = "sass"
add_import_path "sass/components"
extensions_dir = "sass-extensions"
images_dir = "images"
javascripts_dir = "js"
output_style = (environment == :development) ? :expanded : :compressed
relative_assets = true
sass_options = (environment == :development && firesass == true) ? {:debug_info => true} : {}
#
# When true this will cause errors for trying to download files from $base_url/usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/_support.scss
# Errors go away when set to false (in production)
sourcemap = (environment == :development) ? true : false
网上的大多数示例都提供了告诉Chrome本地实例所在位置的说明,但我的本地实例位于虚拟主机上,而不是共享文件系统的Mamp主机 - 因此这些示例无济于事。 / p>
只是要清楚 - 源地图适用于非罗盘核心文件。通过工作我的意思是 - 不要扔掉404并指向开发人员检查器中的正确源代码行。
非常感谢您的帮助。
丹
PS。我已经为sass和指南针尝试了宝石卸载/安装 - 这似乎没什么帮助。