warning insecure world writable dir ruby mode 040777,gem insstal sass error failed to build gem nati

//1.删除原gem源
gem sources --remove https://rubygems.org/

//2.添加国内镜像
gem source -a https://gems.ruby-china.com

//3.打印是否替换成功
gem sources -l

//4.更换成功后打印如下
*** CURRENT SOURCES ***
 https://gems.ruby-china.com
sudo gem install sass
Building native extensions. This could take a while...
ERROR:  Error installing sass:
    ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.5.0/gems/ffi-1.11.1/ext/ffi_c
/usr/bin/ruby2.5 -r ./siteconf20190522-24821-9c6o4.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.5.0/gems/ffi-1.11.1 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/ffi-1.11.1/gem_make.out

这个烂方法不能用

sudo chmod 777 /Library/Ruby/Gems sudo chmod go-w /usr/local/bin

来安装一个homebrew

https://docs.brew.sh/Homebrew-on-Linux

sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

继续按照官方说的做,基本上都是环境的问题。

test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile

安装完毕测试一下

brew install hello

安装了完整版居然好了。。。。好吧

sudo apt-get install ruby-full

如果没好,那就继续

brew install ruby

不知道homebrew的不要问我,因为我也不知道是什么鬼。应该和忍者影分身一种鬼东西。

安装完毕看一下版本号

继续安装sass(我叫他洒洒水)

安装成功,查看一下是否安装成功

landv@Desktop201712556489:~/node$ sass -v
bash: sass: 未找到命令
landv@Desktop201712556489:~/node$ 

悲惨呀,又是环境问题,明明已经安装成功了

换一条路

npm install -g sass

一样的问题,找不到命令

FUCK~~~~

难道只有Deepin是酱紫~~~

好吧曲线救国,直接吧npm下载到的node-sass加入环境变量

综上所述,那就是卸载ruby再进行安装配置,如果还不行那就再卸载一边。

ERROR:  While executing gem ... (Errno::EACCES)
Permission denied @ rb_sysopen - /Library/Ruby/Gems/2.3.0/gems/fuzzy_match-2.1.0/.gitignore

报这个错误就执行

sudo gem install cocoapods-core

然后再安装sass

记住千万不要用deepin自带的ruby

重要的事情不怕多说

sudo apt-get install ruby-full

Linux用流了,要比Windows配置快。

Deepin Linux 绝逼是环境的问题,虽然它不背锅吧。

https://www.cnblogs.com/landv/p/10867433.html(深度Linux /etc/profile 环境变量生效问题)

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

扫码关注云+社区

领取腾讯云代金券