Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.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 语法错误:未找到要导入的文件或文件不可读:compass/css3_Ruby_Css_Sass_Gruntjs_Compass Sass - Fatal编程技术网

Ruby 语法错误:未找到要导入的文件或文件不可读:compass/css3

Ruby 语法错误:未找到要导入的文件或文件不可读:compass/css3,ruby,css,sass,gruntjs,compass-sass,Ruby,Css,Sass,Gruntjs,Compass Sass,我在根目录中已经有一个config.rb,其中包含以下内容: # Require any additional compass plugins here. # Set this to the root of your project when deployed: http_path = "/" css_dir = "css" sass_dir = "sass" images_dir = "images" javascripts_dir = "js" # generated_images_di

我在根目录中已经有一个config.rb,其中包含以下内容:

# Require any additional compass plugins here.

# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "js"

# generated_images_dir = "/images/"
http_generated_images_path = "../images"
我使用的是GrunFile.js,我使其能够编译,但一旦编译文件,我就会出现以下错误:

Running "sass:dist" (sass) task
Syntax error: File to import not found or unreadable: compass/css3.
              Load paths:
                /Users/DanielRamirez/Sites/020
                /Users/DanielRamirez/Sites/020/sass
        on line 86 of sass/_base.scss
        from line 7 of sass/style.scss
  Use --trace for backtrace.
我最近不得不恢复我的硬盘,所以可能有些东西丢失了。我使用以下方法重新安装了指南针:

gem install compass
我有一个macbook,所以我不需要安装ruby,因为如果我理解得好的话,它就在软件包中


我必须做些什么才能使其工作?

这看起来像是您试图通过sass任务sass:dist编译样式,但也使用compass mixin

您使用哪种sass编译器


这是一个好的决定。您应该尝试切换到grunt contrib sass,它具有compass的内部支持。set options compass:true

最近,当我移动到SASS partials/_name.scss的文件结构,然后将我的站点移动到开发环境时,出现了相同的问题。当我打开文件,在空格栏上做了一个小改动并保存后,错误就消失了。我相信还有一种更优雅的方式,但这让我可以继续前进

使用当前版本的grunt contrib sass,您必须在sass任务中将compass选项设置为true,即:

 sass: {
        dis: {
            options: {
                style: 'compressed',
                compass: true
            },
            files: {
                'stylesheets/screen.css' : 'sass/screen.scss'
            }
      }
    },

检查sass/_base.scss的第86行有什么内容?似乎错误表明存在问题。如果你通过Compass而不是Grunt运行它,它能工作吗?@jakerella在第86行,我有第一个Compass导入。具体来说,罗盘/css3。如果我把它去掉,它会在下一个compass导入中给我错误,所以compass本身有一个问题。所以它看起来像是在尝试访问位于这些位置/Users/…的css3 mixin。。。他们在吗?如果没有,是否需要安装它们?或者更改PATH环境变量以正确指向gem安装位置?我想从现在开始使用grunt进行编译。我已经在Gruntfile.js中声明了grunt contrib sass。如何插入此选项?之后,我会检查这是否解决了我的问题;实际上grunt并不编译sass,它只是compass和sass gems的包装器。你能把你的gruntfile发到问题中,然后我可以更正确地更新我的anwser吗