Grunt需要在系统PATH警告中安装指南针

我想安装Yeoman,Grunt和凉亭到我的节点项目。

我在Eclipse中创build了一个节点项目(使用nodeclipse插件),并在cmd中导航到项目文件夹(H:\ Eclipse Workspace \ YoTest),并input:

npm install yo -g npm install generator-webapp -g yo webapp 

select:Sass(带指南针),以cmd为单位

然后键入:

 grunt serve 

运行webapp。

我收到以下错误信息:

 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上。

       

网上收集的解决方案 "Grunt需要在系统PATH警告中安装指南针"

警告似乎是这样说的。

  1. 如果你在OS X或者Linux上,你可能已经安装了Ruby; 用ruby -v在你的terminaltesting。 当你确认你已经安装了Ruby时,运行gem update --system && gem install compass来安装Compass和Sass。

  2. 如果这没有帮助,请按照https://github.com/gruntjs/grunt-contrib-compass中的说明安装grunt-contrib-compass软件包

我在运行一个吞咽手表的时候也遇到了同样的错误信息,尽pipe安装,重新安装,重新启动,它仍然会显示出来。

通过卸载我所有的软件包来获得它的工作:

 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. 

现在,不要问我为什么,但这一切工作:-)

希望能帮助那里的任何人,我真的在这一个努力…

只需要在console – >(或者sudo)gem install compass上写,因为npm命令不会做任何事情

对于Mac OS X 10.10(优胜美地)

search已安装的ruby版本ruby -v 。 如果使用sudo gem update --system else使用\curl -sSL https://get.rvm.io | bash -s stable --ruby安装rvm与ruby \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和rubygem,这反过来又促进了Sass和指南针的安装。 看看这个http://hecktechsolutions.blogspot.in/2015/03/installation-of-gems-compass-and-sass.html