安装Rubygems没有互联网连接

时间:2015-05-20 12:02:14

标签: ruby linux installation compass-sass offline

有没有办法离线安装指南针 compass_radix

当我尝试命令行安装时,我得到以下内容:

sudo gem install compass
WARNING:  Error fetching data: bad response Service Unavailable 503 (http://rubygems.org/latest_specs.4.8.gz)
WARNING:  Error fetching data: bad response Service Unavailable 503 (http://rubygems.org/specs.4.8.gz)
    Compass is charityware. If you love it, please donate on our behalf at http://umdf.org/compass Thanks!
Successfully installed compass-1.0.3
1 gem installed
Installing ri documentation for compass-1.0.3...
Installing RDoc documentation for compass-1.0.3...

sudo gem install compass_radix
WARNING:  Error fetching data: bad response Service Unavailable 503 (http://rubygems.org/latest_specs.4.8.gz)
ERROR:  Could not find a valid gem 'compass_radix' (>= 0) in any repository
ERROR:  Possible alternatives: compass_radix

1 个答案:

答案 0 :(得分:1)

如果是防火墙问题,您也可以直接通过浏览器下载gems:

请注意,您还需要这些gems的运行时依赖项。

另一种方法是使用gem fetch

从可以访问互联网的计算机上下载它们
gem fetch compass
gem fetch compass_radix

如果是第二种情况,请将这些文件放在USB密钥上并将其带到没有互联网的其他计算机上,然后使用格式进行安装

cd <directory where gemfiles are>
gem install ./compass-x.x.x.gem
gem install ./compass_radix-x.x.x.gem

在尝试gem install <gemfile>之前,您应该将所有宝石存储在同一目录(compass,compass_radix和所有运行时依赖项)中。