Could not find a valid gem 'compass' (>= 0) in any repository compass安装失败解决方案

安装完成ruby gem 之后,通过 gem install compass 安装compass~~

出现如下报错

Could not find a valid gem 'compass' (>= 0) in any repository

然后尝试在 https://rubygems.org/ 下载 compass-1.0.3.gem 本地安装

又提示了 rb-inotify 安装失败~~

一个个安装失败,这个时候 可以怀疑一下 是不是网络问题,无法连接 rubygems 库~

是不是被墙了呢? 于是在网上找到 以下FQ的方法

1、依次执行下面三条命令,移除旧源,改用新源
 gem sources --remove http://rubygems.org/
 gem sources --remove https://rubygems.org/
 gem sources -a https://gems.ruby-china.org/  2、然后执行下面的命令,查看源列表
 gem sources -l  应该会是下面输出*** CURRENT SOURCES ***  https://gems.ruby-china.org/  (请确保只有 https://gems.ruby-china.org/)3、然后就可以安装compass了> gem install compass

当我 执行 gem sources -l 的时候发现 没有资源源,难怪无法下载~

然后尝试添加source 最终完成成功添加 http://rubygems.org/ source

成功添加source 之后,成功安装 compass

(0)

相关推荐