使用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. goodAddr

    http://www.tuicool.com/articles/ZV7vya    [tungsten'实时'同步mysql数据到mongodb]

  2. F - Warm up - hdu 4612(缩点+求树的直径)

    题意:有一个无向连通图,现在问添加一条边后最少还有几个桥 分析:先把图缩点,然后重构图为一棵树,求出来树的直径即可,不过注意会有重边,构树的时候注意一下 *********************** ...

  3. ajax提交数据问题

    加入traditional:true属性 traditional 类型:Boolean 如果你想要用传统的方式来序列化数据,那么就设置为 true.请参考工具分类下面的 jQuery.param 方法 ...

  4. windows 编程 —— 消息与参数(滚动条、键盘、鼠标)

    目录: 滚动条 键盘 鼠标 滚动条ScrollBar 发送消息:WM_VSCROLL和WM_HSCROLL 参数wParam:wParam消息参数被分为一个低字组和一个高字组.wParam的低字组是一 ...

  5. jsp 常用9大内置对象

    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ...

  6. 通过jdbc取得数据库表结构信息

    做制作开发平台时,首要的一点是如何取得数据库表结构信息.一般通用的做法就是通过JDBC中的ResultSetMetaData类来进行操作,当你取得了数据库表结构信息后,比如说表的每个字段名称,字段类型 ...

  7. Spring 3 来创建 RESTful Web Services

    Spring 3 创建 RESTful Web Services 在 Java™ 中,您可以使用以下几种方法来创建 RESTful Web Service:使用 JSR 311(311)及其参考实现 ...

  8. C primer plus 读书笔记第八章

    本章的标题是字符输入/输出和输入确认.主要内容是讨论用于I/O的标准函数. 1.getchar()和putchar() 这两个函数之前用过,我们通过这两个函数来讨论下缓冲区. #include &qu ...

  9. hdu 3642 Get The Treasury (三维的扫描线)

    题目大意: 给出N个立方体. 求一个三维空间中被包围三次的空间的体积之和. 思路分析: 发现Z的范围非常小.那么我们能够枚举Z轴,然后对 x y做扫描线. 并且不用枚举全部的Z ,仅仅须要将Z离散化之 ...

  10. java JMS消息队列

    http://blog.csdn.net/shirdrn/article/details/6362792 http://haohaoxuexi.iteye.com/blog/1893038 http: ...