如何在centos7上安装ruby和compass
Posted 陈小峰_iefreer
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何在centos7上安装ruby和compass相关的知识,希望对你有一定的参考价值。
踏得网迁移服务器(CentOS5->CentOS7)时,遇到了一些麻烦,这里记录一下。
Compass是用来编译SCSS语法的,依赖于Ruby,虽然目前该项目可能已经不再活跃,但不能影响历史代码的应用。
yum install centos-release-scl-rh centos-release-scl
next install the right version
yum --enablerepo=centos-sclo-rh install rh-ruby26
then enable ruby2.6 in bash
scl enable rh-ruby26 bash
If you would like the change to be permanent (the change still persists after you log out and log back in)
you can edit your $HOME/.bashrc file to include the following line:
source scl_source enable rh-ruby26
to verify if ruby 2.6 is installed properly or not:
ruby --version
ruby 2.6.2p47 (2019-03-13 revision 67232)
Ensure you install the header files when you compile gem
yum install http://mirror.centos.org/centos/7/sclo/x86_64/rh/rh-ruby26/rh-ruby26-ruby-devel-2.6.2-118.el7.x86_64.rpm
或者 yum --enablerepo=centos-sclo-rh-testing install rh-ruby26-ruby-devel
Finally
gem install compass
以上是关于如何在centos7上安装ruby和compass的主要内容,如果未能解决你的问题,请参考以下文章