老师,sass安装不上

来源:12-2 线上服务器环境搭建

TheBayMax

2017-10-09

nodejs、ruby、gem、webpack都安装了,用过好几种语句,sass还是装不上,提示如下

Tom@Tom-PC MINGW64 ~/Desktop
$ ssh root@101.132.140.8
root@101.132.140.8's password:
Last login: Mon Oct  9 22:19:32 2017 from 124.74.107.114

Welcome to Alibaba Cloud Elastic Compute Service !

-bash: unse: command not found
-bash: rt: command not found
[root@iZuf6c3lh54r8qj8l3o6zlZ ~]# cd /usr/local/
[root@iZuf6c3lh54r8qj8l3o6zlZ local]# ruby -v
ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
[root@iZuf6c3lh54r8qj8l3o6zlZ local]# gem -v
1.3.7
[root@iZuf6c3lh54r8qj8l3o6zlZ local]# webpack -v
2.6.1
[root@iZuf6c3lh54r8qj8l3o6zlZ local]#
[root@iZuf6c3lh54r8qj8l3o6zlZ local]#
[root@iZuf6c3lh54r8qj8l3o6zlZ local]# sudo gem install sass@3.4.24
 ERROR:  Could not find a valid gem 'sass@3.4.24' (>= 0) in any repository
[root@iZuf6c3lh54r8qj8l3o6zlZ local]#  sass -v
-bash: sass: command not found
[root@iZuf6c3lh54r8qj8l3o6zlZ local]# sudo su -c "gem install sass"
Building native extensions.  This could take a while...
ERROR:  Error installing sass:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/ffi-1.9.18 for in                                                                                                                                                                                                                                                                                           spection.
Results logged to /usr/lib/ruby/gems/1.8/gems/ffi-1.9.18/ext/ffi_c/gem_make.out
[root@iZuf6c3lh54r8qj8l3o6zlZ local]# sass -v
-bash: sass: command not found
[root@iZuf6c3lh54r8qj8l3o6zlZ local]# sudo gem install sass --no-user-install
Building native extensions.  This could take a while...
ERROR:  Error installing sass:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/ffi-1.9.18 for in                                                                                                                                                                                                                                                                                           spection.
Results logged to /usr/lib/ruby/gems/1.8/gems/ffi-1.9.18/ext/ffi_c/gem_make.out
[root@iZuf6c3lh54r8qj8l3o6zlZ local]# sass -v
-bash: sass: command not found
[root@iZuf6c3lh54r8qj8l3o6zlZ local]#
[root@iZuf6c3lh54r8qj8l3o6zlZ local]#
[root@iZuf6c3lh54r8qj8l3o6zlZ local]#
[root@iZuf6c3lh54r8qj8l3o6zlZ local]# sudo yum install rubygems
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
Package rubygems-1.3.7-5.el6.noarch already installed and latest version
Nothing to do
[root@iZuf6c3lh54r8qj8l3o6zlZ local]# sass
-bash: sass: command not found
[root@iZuf6c3lh54r8qj8l3o6zlZ local]# sudo gem install sass
Building native extensions.  This could take a while...
ERROR:  Error installing sass:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/ffi-1.9.18 for in                                                                                                                                                                                                                                                                                           spection.
Results logged to /usr/lib/ruby/gems/1.8/gems/ffi-1.9.18/ext/ffi_c/gem_make.out
[root@iZuf6c3lh54r8qj8l3o6zlZ local]# sass
-bash: sass: command not found
[root@iZuf6c3lh54r8qj8l3o6zlZ local]#


写回答

1回答

TheBayMax

提问者

2017-10-10

解决,用rvm安装了 ruby  再gem install sass  就安装好了

0
11
Rosen
回复
侧耳倾听1614427
按着课程里的版本来,可以看源码里的 package.json 文件
2018-10-24
共11条回复

真实数据对接 从0开发前后端分离的企业级上线项目

【毕设项目精品】前端实战,对接真实服务端数据,开发完整项目

4262 学习 · 4113 问题

查看课程