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

出现如下报错

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

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

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

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

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

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

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

http://blog.csdn.net/lovelyelfpop/article/details/39053021

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

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

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

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

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

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

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

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

05-06 03:06