错误“Compass无法找到任何要编译的Sass文件。”在罗盘上创建

时间:2014-10-15 14:42:21

标签: twitter-bootstrap ubuntu gem sass compass

运行compass create my-theme -r bootstrap-sass --using bootstrap时出现以下错误:

$ compass create my-theme -r bootstrap-sass --using bootstrap
directory my-theme/ 
   create my-theme/config.rb 
Compass can't find any Sass files to compile.
Is your compass configuration correct?.
If you're trying to start a new project, you have left off the directory argument.
Run "compass -h" to get help.

我在运行上述命令的任何目录中都收到此错误。

我该如何解决这个问题?

相关产出:

$ compass --version
Compass 1.0.1 (Polaris)
Copyright (c) 2008-2014 Chris Eppstein
Released under the MIT License.
Compass is charityware.
Please make a tax deductable donation for a worthy cause: http://umdf.org/compass
$ sass --version
Sass 3.4.5 (Selective Steve)
$ gem --version
2.2.2

2 个答案:

答案 0 :(得分:3)

在某处看起来像是错误的配置。重新安装rubygemsasscompass,这应该是固定的。

安装aptitude

sudo apt-get install aptitude

清洗

卸载ruby

sudo aptitude purge ruby

请确保您没有任何其他红宝石套餐(例如ruby2.1

sudo aptitude purge ruby2.1

删除未通过aptitude

删除的可执行文件
rm -rf /usr/local/lib/ruby
rm -rf /usr/lib/ruby
rm -f /usr/local/bin/ruby
rm -f /usr/bin/ruby
rm -f /usr/local/bin/irb
rm -f /usr/bin/irb
rm -f /usr/local/bin/gem
rm -f /usr/bin/gem
sudo rm -f /usr/local/bin/sass
sudo rm -f /usr/local/bin/compass

全新安装

ruby

sudo apt-get install ruby-full rubygems-integration

sass

sudo gem install sass

compass

sudo gem install compass

现在我们全新安装了rubygemsasscompass


让我们检查现在一切都运转良好:

$ compass create my-theme -r bootstrap-sass --using bootstrap
directory my-theme/ 
directory my-theme/fonts/bootstrap/ 
directory my-theme/javascripts/ 
directory my-theme/javascripts/bootstrap/ 
directory my-theme/sass/ 
directory my-theme/stylesheets/ 
   create my-theme/config.rb 
   create my-theme/sass/styles.scss 
   create my-theme/sass/_bootstrap-variables.scss 
   create my-theme/javascripts/bootstrap/affix.js 
   create my-theme/javascripts/bootstrap/transition.js 
   create my-theme/javascripts/bootstrap/collapse.js 
   create my-theme/javascripts/bootstrap/scrollspy.js 
   create my-theme/javascripts/bootstrap/tooltip.js 
   create my-theme/javascripts/bootstrap/dropdown.js 
   create my-theme/javascripts/bootstrap/button.js 
   create my-theme/javascripts/bootstrap/alert.js 
   create my-theme/javascripts/bootstrap/popover.js 
   create my-theme/javascripts/bootstrap/carousel.js 
   create my-theme/javascripts/bootstrap/tab.js 
   create my-theme/javascripts/bootstrap/modal.js 
   create my-theme/javascripts/bootstrap.js 
   create my-theme/javascripts/bootstrap-sprockets.js 
   create my-theme/fonts/bootstrap/glyphicons-halflings-regular.woff 
   create my-theme/fonts/bootstrap/glyphicons-halflings-regular.eot 
   create my-theme/fonts/bootstrap/glyphicons-halflings-regular.svg 
   create my-theme/fonts/bootstrap/glyphicons-halflings-regular.ttf 
    write my-theme/stylesheets/styles.css

*********************************************************************
Congratulations! Your compass project has been created.

You may now add and edit sass stylesheets in the sass subdirectory of your project.

Sass files beginning with an underscore are called partials and won't be
compiled to CSS, but they can be imported into other sass stylesheets.

You can configure your project by editing the config.rb configuration file.

You must compile your sass stylesheets into CSS when they change.
This can be done in one of the following ways:
  1. To compile on demand:
     compass compile [path/to/project]
  2. To monitor your project for changes and automatically recompile:
     compass watch [path/to/project]

More Resources:
  * Website: http://compass-style.org/
  * Sass: http://sass-lang.com
  * Community: http://groups.google.com/group/compass-users/


To import your new stylesheets add the following lines of HTML (or equivalent) to your webpage:
<head>
  <link href="/stylesheets/styles.css" rel="stylesheet" type="text/css" />
</head>

答案 1 :(得分:0)

令人难以置信的,罗盘在带空格的目录上窒息(我认为,至少在Windows机器上)。

我已经通过从存储库创建一个没有空格的文件夹来解决它 - 请参阅这个非常棒的实用程序:http://schinagl.priv.at/nt/hardlinkshellext/linkshellextension.html

值得深思:考虑是否需要SASS,你想调试你的SASS还是CSS?

sass-can-not-find-any-files-fix