簡體   English   中英

Grunt 需要在系統路徑中安裝指南針警告

[英]Grunt need compass installed in system PATH Warning

我想將 Yeoman、Grunt 和 bower 安裝到我的節點項目中。

我在 Eclipse 中創建了一個節點項目(使用 nodeclipse 插件)並導航到 cmd 中的項目文件夾(即 H:\\Eclipse Workspace\\YoTest)並輸入:

npm install yo -g

npm install generator-webapp -g

yo webapp

選擇:Sass(帶指南針),在 cmd 中

然后輸入:

grunt serve

運行 web 應用程序。

我收到以下錯誤消息:

Done, without errors.
    Warning: Running "compass:server" (compass) task
Warnin: You need to have Ruby and Compass installed and in your system PATH for
 this task to work. More info: https://github.com/gruntjs/grunt-contrib-compass
Use --force to continue.

Aborted due to warnings. Use --force to continue.

    Aborted due to warnings.

我如何解決這個問題,以便我可以用 grunt 運行我的節點項目?

PS:我不確定它是否與問題有關,但我在 package.json 的第 1-27 行也收到以下錯誤:

Multiple markers at this line
    - strings must use singlequote
    - strings must use singlequote

這是我的 package.json

{
  "name": "yotest2",
  "version": "0.0.0",
  "dependencies": {},
  "devDependencies": {
    "grunt": "~0.4.1",
    "grunt-contrib-copy": "~0.4.1",
    "grunt-contrib-concat": "~0.3.0",
    "grunt-contrib-uglify": "~0.2.0",
    "grunt-contrib-compass": "~0.7.0",
    "grunt-contrib-jshint": "~0.7.0",
    "grunt-contrib-cssmin": "~0.7.0",
    "grunt-contrib-connect": "~0.5.0",
    "grunt-contrib-clean": "~0.5.0",
    "grunt-contrib-htmlmin": "~0.1.3",
    "grunt-bower-install": "~0.7.0",
    "grunt-contrib-imagemin": "~0.2.0",
    "grunt-contrib-watch": "~0.5.2",
    "grunt-rev": "~0.1.0",
    "grunt-autoprefixer": "~0.5.0",
    "grunt-usemin": "~2.0.0",
    "grunt-mocha": "~0.4.0",
    "grunt-modernizr": "~0.4.0",
    "grunt-newer": "~0.6.0",
    "grunt-svgmin": "~0.2.0",
    "grunt-concurrent": "~0.4.0",
    "load-grunt-tasks": "~0.2.0",
    "time-grunt": "~0.2.0",
    "jshint-stylish": "~0.1.3"
  },
  "engines": {
    "node": ">=0.8.0"
  }
}

我在 Windows 上。

警告似乎說明了一切。

  1. 如果您使用的是 OS X 或 Linux,您可能已經安裝了 Ruby; 在終端中使用ruby -v進行測試。 確認安裝了 Ruby 后,運行gem update --system && gem install compass來安裝 Compass 和 Sass。

  2. 如果這沒有幫助,請按照https://github.com/gruntjs/grunt-contrib-compass上的說明安裝grunt-contrib-compass

在運行 gulp watch 時,我為同樣的錯誤消息苦苦掙扎了幾個小時,盡管安裝、重新安裝、重新啟動,它仍然會出現。

通過卸載我的所有軟件包使其工作:

sudo gem uninstall bundler bundle compass sass compass-core compass-import-once

並且只安裝包

sudo gem install bundle bundler

然后運行神奇地安裝了我需要的一切的命令:

$ bundle
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/..
Installing sass 3.4.9
Installing sassy-maps 0.4.0
Installing breakpoint 2.5.0
Installing hitimes 1.2.2
Installing timers 4.0.1
Installing celluloid 0.16.0
Using chunky_png 1.3.3
Using multi_json 1.10.1
Installing compass-core 1.0.1
Using compass-import-once 1.0.5
Using rb-fsevent 0.9.4
Using ffi 1.9.6
Using rb-inotify 0.9.5
Installing compass 1.0.1
Installing json 1.8.1
Installing listen 2.8.3
Installing thor 0.19.1
Installing fontcustom 1.3.7
Installing modular-scale 2.0.5
Installing normalize-scss 3.0.2
Installing sass-css-importer 1.0.0.beta.0
Installing sassy-buttons 0.2.6
Installing susy 2.1.3
Using bundler 1.8.0
Bundle complete! 9 Gemfile dependencies, 24 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from compass:
    Compass is charityware. If you love it, please donate on our behalf at http://umdf.org/compass Thanks!
Post-install message from fontcustom:
>> Thanks for installing Font Custom! Please ensure that fontforge is installed before compiling any icons. Visit <http://fontcustom.com> for instructions.

現在,不要問我為什么,但這一切都有效:-)

希望可以幫助那里的任何人,我真的在這個問題上很掙扎......

只需要在控制台上寫 -> (或 sudo )gem install compass ,因為 npm 命令不會做任何事情

對於 Mac OS X 10.10(優勝美地)

搜索已安裝的 ruby​​ 版本ruby -v 如果存在使用sudo gem update --system更新 gems 使用\\curl -sSL https://get.rvm.io | bash -s stable --ruby使用 ruby​​ 安裝 rvm \\curl -sSL https://get.rvm.io | bash -s stable --ruby \\curl -sSL https://get.rvm.io | bash -s stable --ruby

然后安裝 Xcode 命令行工具xcode-select --install 這將需要一些時間。

現在使用sudo gem install compass 對我來說,這就像一種魅力。

應該安裝 Ruby 和 Ruby Gems,這反過來又方便了 Sass 和指南針的安裝。 看看這個http://hecktechsolutions.blogspot.in/2015/03/installation-of-gems-compass-and-sass.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM