使用grunt serve运行时遇到一问题:

y@y:ydkt$ grunt serve
Running "serve" task Running "clean:server" (clean) task
Cleaning .tmp...OK Running "env:all" (env) task Running "injector:sass" (injector) task
Missing option `template`, using `dest` as template instead
Injecting scss files ( files)
>> Nothing changed Running "concurrent:server" (concurrent) task
Warning: Running "sass:server" (sass) task
Warning:
You need to have Ruby and Sass installed and in your PATH for this task to work.
More info: https://github.com/gruntjs/grunt-contrib-sass
Use --force to continue. Aborted due to warnings. Execution Time (-- :: UTC)
loading tasks 209ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ %
sass:server 8ms ▇▇ %
Total 218ms Use --force to continue. Aborted due to warnings. Execution Time (-- :: UTC)
loading tasks 114ms ▇▇▇▇▇▇▇▇▇▇ %
serve 22ms ▇▇ %
clean:server 92ms ▇▇▇▇▇▇▇▇ %
injector:sass 94ms ▇▇▇▇▇▇▇▇ %
concurrent:server 602ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ %
Total 934ms

问题是:提示我Ruby 与Sass未进行安装配置:

Warning: Running "sass:server" (sass) task
Warning:
You need to have Ruby and Sass installed and in your PATH for this task to work.
More info: https://github.com/gruntjs/grunt-contrib-sass
Use --force to continue.

我 ruby -v 查看了以下ruby 版本为1.9.1 ubuntu已经进行预装了,查看了以下需要安装compass才可以编译sass.

下面进行安装compass:

y@y:ydkt$ sudo gem install compass
Fetching: sass-3.4..gem (%)
Fetching: multi_json-1.11..gem (%)
Fetching: compass-core-1.0..gem (%)
Fetching: compass-import-once-1.0..gem (%)
Fetching: chunky_png-1.3..gem (%)
Fetching: rb-fsevent-0.9..gem (%)
Fetching: ffi-1.9..gem (%)
Building native extensions. This could take a while...
ERROR: Error installing compass:
ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9./rubygems/custom_require.rb::in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9./rubygems/custom_require.rb::in `require'
from extconf.rb::in `<main>' Gem files will remain installed in /var/lib/gems/1.9./gems/ffi-1.9. for inspection.
Results logged to /var/lib/gems/1.9./gems/ffi-1.9./ext/ffi_c/gem_make.out

提示我ruby 版本过低,

Gem files will remain installed in /var/lib/gems/1.9.1/gems/ffi-1.9.8 for inspection

下一步要更新我的ruby 版本,安装2.1.2

sudo apt-get -y update
sudo apt-get install cmake sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev
libncurses5-dev libffi-dev curl git-core openssh-server redis-server postfix checkinstall libxml2-dev
libxslt-dev libcurl4-openssl-dev libicu-dev mysql-client libmysqlclient-dev libreadline6-dev curl --progress http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz | tar xz
cd ruby-2.1.
./configure
make
sudo make install

安装成功:

y@y:~$ ruby -v
ruby 2.1.2p95 (-- revision ) [x86_64-linux]
y@y:~$

再次重新安装compass:

y@y:ydkt$ sudo gem install compass
[sudo] password for y:
Fetching: sass-3.4..gem (%)
Successfully installed sass-3.4.
Fetching: multi_json-1.11..gem (%)
Successfully installed multi_json-1.11.
Fetching: compass-core-1.0..gem (%)
Successfully installed compass-core-1.0.
Fetching: compass-import-once-1.0..gem (%)
Successfully installed compass-import-once-1.0.
Fetching: chunky_png-1.3..gem (%)
Successfully installed chunky_png-1.3.
Fetching: rb-fsevent-0.9..gem (%)
Successfully installed rb-fsevent-0.9.
Fetching: ffi-1.9..gem (%)
Building native extensions. This could take a while...
Successfully installed ffi-1.9.
Fetching: rb-inotify-0.9..gem (%)
Successfully installed rb-inotify-0.9.
Fetching: compass-1.0..gem (%)
Compass is charityware. If you love it, please donate on our behalf at http://umdf.org/compass Thanks!
Successfully installed compass-1.0.
Parsing documentation for chunky_png-1.3.
Installing ri documentation for chunky_png-1.3.
Parsing documentation for compass-1.0.
Installing ri documentation for compass-1.0.
Parsing documentation for compass-core-1.0.
Installing ri documentation for compass-core-1.0.
Parsing documentation for compass-import-once-1.0.
Installing ri documentation for compass-import-once-1.0.
Parsing documentation for ffi-1.9.
Installing ri documentation for ffi-1.9.
Parsing documentation for multi_json-1.11.
Installing ri documentation for multi_json-1.11.
Parsing documentation for rb-fsevent-0.9.
Installing ri documentation for rb-fsevent-0.9.
Parsing documentation for rb-inotify-0.9.
Installing ri documentation for rb-inotify-0.9.
Parsing documentation for sass-3.4.
Installing ri documentation for sass-3.4.
Done installing documentation for chunky_png, compass, compass-core, compass-import-once, ffi, multi_json, rb-fsevent, rb-inotify, sass after seconds
gems installed

此时执行grunt serve,之前的错误已经没有了,但是又出现了新的错误:

Running "open:server" (open) task
Warning: Command failed: /bin/sh -c /home/y/my_git/ydkt/node_modules/open/vendor/xdg-open "http://localhost:9000"
/bin/sh: : /home/y/my_git/ydkt/node_modules/open/vendor/xdg-open: Permission denied
Use --force to continue. Aborted due to warnings.

提示:拒绝访问!修改文件权限:

y@y:open$ cd vendor/
y@y:vendor$ chmod xdg-open
y@y:vendor$ ll
总用量
drwxrwxr-x y y 5月 : ./
drwxrwxr-x y y 5月 : ../
-rwxrwxrwx y y 5月 : xdg-open*
y@y:vendor$

最后执行grunt serve成功!!!

grunt serve Warning: Running "sass:server" (sass) task的更多相关文章

  1. yeoman运行grunt serve 提示错误

    今天在使用 yeoman 的时候,当我运行 grunt serve 命令的时候,出现如下提示: 1.Error: Cannot find module 'load-grunt-tasks' $ gru ...

  2. Sass实战 sass官网

    Sass实战 sass官网 1.相关视频教程:http://pan.baidu.com/s/1eSl8bUa 1.1我的项目源码:http://pan.baidu.com/s/1dFmqbyp 1.2 ...

  3. php-fpm: 某项目网站频繁出现503问题解决( WARNING: [pool www] server reached pm.max_children setting (50), consider raising it)

    服务是nginx+php-fpm配置, 在运行过一段时间后,会经常出现: WARNING: [pool www] server reached pm.max_children setting (50) ...

  4. SASS - 使用Sass程序

    SASS – 简介 SASS – 环境搭建 SASS – 使用Sass程序 SASS – 语法 SASS – 变量 SASS- 局部文件(Partial) SASS – 混合(Mixin) SASS ...

  5. angular项目grunt serve报错Cannot find where you keep your Bower packages

    运行angular项目grunt serve一直报错,截图如下: 无法找到报错Bower包的位置. 解决方法: 1.全局安装bower npm install bower -g 2.检查是否安装成功 ...

  6. grunt入门讲解4:如何创建task(任务)

    每当运行Grunt时, 你可以为其指定一个或多个任务, 这些任务用于告诉Grunt你想要它做什么事情. 如果你没有指定一个任务,并且你已经定义一个名为 "default" 的任务, ...

  7. SASS教程sass超详细教程

    SASS安装及使用(sass教程.详细教程) 采用SASS开发CSS,可以提高开发效率. SASS建立在Ruby的基础之上,所以得先安装Ruby. Ruby的安装: 安装 rubyinstaller- ...

  8. vue+sass 下sass不能运行问题

    好久没写博文了,今天抽空写一写,最近在用vue.js build 项目,今早想使用sass来编译css,可是安装好依赖包之后仍然显示一下错误: ERROR in ENOENT: no such fil ...

  9. Darwin Streaming server 的 Task 类

    Darwin Streaming Server 是一个开放源代码的streaming server,对于streaming server的编程和软件结构有着一定的参考价值,它是使用C++写的,其中的并 ...

随机推荐

  1. Shell遍历文件,对每行进行正则匹配

    Shell查看文件的最后5行,并对每行进行正则匹配,代码如下: #!/bin/sh pattern="HeartBeat" /home/test/log/log_20150205. ...

  2. Flume源码-LoggerSink

    package org.apache.flume.sink; import com.google.common.base.Strings; import org.apache.flume.Channe ...

  3. windows快捷键和命令

    以管理员方式打开命令行界面:win+X+A 打开服务界面:services.msc 删掉windows系统记住的WIFI密码 cmd下面运行 显示存储的无线连接netsh wlan show prof ...

  4. 告诉你LTE-FDD与LTE-TDD的区别

    [PConline 技术分析]移动早在去年已经拿下了TD-LTE的4G牌照,而中国联通与中国电信的FDD-LTE的牌照在近日正式拿下,而对于4G网络,有多少真正了解呢?接下来笔者就为大家解释一下4G的 ...

  5. 树莓派学习笔记——交叉编译练习之SQLite3安装

    0.前言     本博文可能并没有太多使用价值.不过为了练习而练习.在树莓派上使用SQLite有非常多的方法,安装的方法也有非常多.     [1]假设使用Python,那么不必安装SQLite由于P ...

  6. Linux驱动开发cdev驱动分层设计

    #ifndef MYDEV_H #define MYDEV_H #define DYNAMIC_MINOR 256 struct mydev{ const char *name; const stru ...

  7. Bzoj3990 [SDOI2015]排序

    Time Limit: 20 Sec  Memory Limit: 128 MBSubmit: 651  Solved: 338 Description 小A有一个1-2^N的排列A[1..2^N], ...

  8. CSS元素分类及区别

    元素是文档结构的基础,在CSS中,每个元素生成了一个包含了元素内容的框(box,也译为“盒子”).但是不同的元素显示的方式会有所不同,例如<div>和<span>就不同,而&l ...

  9. CactiEZ 中文版V10.1安装使用以及139邮箱短信报警设置

    说明:CactiEZ中文版V10.1是基于CentOS 6.0系统,整合Cacti等相关软件,重新编译而成的一个操作系统!   说明:CactiEZ中文版V10.1是基于CentOS 6.0系统,整合 ...

  10. 全世界最详细的一步一步搭建RAC步骤(一)---安装操作系统RHEL4.6【weber出品】

    全文搭建RAC分为3步骤 <--安装操作系统RHEL4.6> <--配置ASM+裸设备> <--安装集群软件>       <--安装数据库软件>   ...