魅力程序猿

  • 首页
  • Java
  • Android
  • APP
    • 扑克计分器
    • Video Wallpaper
  • 联系我
  • 关于我
  • 资助
道子
向阳而生
  1. 首页
  2. Sass
  3. 正文

windows上Sass安装

2016年1月22日 6455点热度 0人点赞 4条评论

在 Windows 平台下安装 Ruby 需要先有 Ruby 安装包,大家可以到 Ruby 的(http://rubyinstaller.org/downloads)下载对应需要的 Ruby 版本。

54f560af00017cf106790364

Ruby 安装文件下载好后,可以按应用软件安装步骤进行安装 Ruby。在安装过程中,个人建议将其安装在 C 盘下,在安装过程中选择第二个选项(不选中,就会出现编译时找不到Ruby环境的情况),如下图所示:

54f561190001531806350474

Ruby 安装完成后,在开始菜单中找到新安装的 Ruby,并启动 Ruby 的 Command 控制面板,如下图所示:

54f5615f00011cb604530648

当你的电脑中安装好 Ruby 之后,接下来就可以安装 Sass 了。同样的在windows下安装 Sass 有多种方法。但这几种方法都是非常的简单,只需要在你的命令终端输入一行命令即可。

1、通过命令安装 Sass

打开电脑的命令终端,输入下面的命令:

gem install sass

提醒一下,在使用 Mac 的同学,可能需要在上面的命令前加上"sudo",才能正常安装:

sudo gem install sass

如果上面的方法没有安装成功,可以使用下面的两种方法。

2、通过 Compass 来安装 Sass

除了使用 gem 命令来安装 Sass 之外,还可以通过安装 compass来安装 Sass,因为 Compass 是基于 Sass 开发的一个框架。也就是说,你安装了 Compass,也就同时安装好了 Sass。

同样的在你的命令终端输入下面的命令:

sudo gem install sass

执行完上面的命令之后,就开始安装 Compass 和 Sass。

注:Compass 是一个成熟的、基于 Sass 开发的一个框架,这里面集成了很多写好的 mixins 和 Sass 函数。不过在此暂不做过多阐述。

3、本地安装 Sass

由于有时候直接使用上面的命令安装会让你无法正常实现安装(网络受限原因),当碰到这种情况之时,那么安装需要特殊去处理,可以通过下面的方法来实现 Sass 的正常安装:

可以到 Rubygems(http://rubygems.org/) 网站上将 Sass 的安装包(http://rubygems.org/gems/sass)下载下来,然后在命令终端输入:

gem install <把下载的安装包拖到这里>

直接回车即可安装成功。

注:在 iOSX 系统平台,可以直接将下载的安装包拖到 "gem install" 后面,如果在是 Windows 系统,需要手功输入安装的文件路径。

  4、淘宝 RubyGems 镜像安装 Sass

除了下载 Sass 安装包到本地安装之外,碰到网络原因无法安装时还可以使用淘宝 RubyGems 镜像安装 Sass。只是我们需要通过 gem sources 命令来配置源,先移除默认的 https://rubygems.org 源,然后添加淘宝的源 https://ruby.taobao.org:

第一步:移动默认的源

gem sources --remove https://rubygems.org/

第二步:指定淘宝的源

gem sources -a https://ruby.taobao.org/

第三步:查看指定的源是不是淘宝源

gem sources -l

返回结果如下:

*** CURRENT SOURCES ***
https://ruby.taobao.org

请确保只有 ruby.taobao.org。如果无误之后,执行下面的命令:

gem install sass

 

标签: Sass安装(windows版) windows下Sass安装
最后更新:2016年1月22日

daozi

这个人很懒,什么都没留下

点赞
下一篇 >

文章评论

  • Almena

    Taking the ovwierev, this post hits the spot

    2016年12月18日
    回复
  • Jacki

    Hello! I’m at work browsing your blog from my new iphone 4! Just wanted to say I love reading through your blog and look forward to all your posts! Keep up the oudtsanting work!

    2016年12月19日
    回复
  • try this

    I just want to tell you that I am just all new to blogging and absolutely savored your blog. Probably I’m want to bookmark your website . You actually come with fabulous well written articles. Thanks a bunch for sharing your web-site.

    2017年2月8日
    回复
  • important site

    I simply want to mention I am newbie to blogs and seriously enjoyed this blog site. Very likely I’m planning to bookmark your blog post . You surely have wonderful well written articles. Thank you for sharing your website.

    2018年1月27日
    回复
  • razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
    取消回复
    搜索
    联系方式

    QQ群:179730949
    QQ群:114559024
    欢迎您加入Android大家庭
    本人QQ:136049925

    赐我一丝安慰
    给我一点鼓励

    COPYRIGHT © 2023 魅力程序猿. ALL RIGHTS RESERVED.

    Theme Kratos Made By Seaton Jiang

    豫ICP备15000477号