【转】Windows本地方式安装OpenShift客户端工具rhc

在Windows环境下搭建OpenShift环境,安装客户端工具rhc,首先需要安装Ruby和Git,参阅https://developers.openshift.com/en/getting-started-client-tools.html#windows

在正确安装Ruby和Git之后,使用RubyGems包管理器(Ruby内置)安装OpenShift的客户端工具rhc。

官方提供的方式为:gem install rhc,但可能是网络原因所致,执行命令后提示错误信息:

ERROR:  Could not find a valid gem ‘rhc’ (>= 0), here is why:

Unable to download data from https://rubygems.org/ – Errno::ECONNREFUS

ED: No connection could be made because the target machine actively refused it.

– connect(2) (https://rubygems.org/latest_specs.4.8.gz)

参阅StackOverFlow的一个解答:http://stackoverflow.com/questions/19745960/unable-to-install-any-gem-by-ruby-in-windows

“This is most likely due to running over a secure (https) connection to rubygems.org. Look at the help for “gem sources –h”, remove the https version and add http://rubygems.org”

问题仍然没有解决。

实际上,gem install支持本地方式安装,即将gem包下载到本地后再执行gem install –local,参阅http://stackoverflow.com/questions/220176/how-can-i-install-a-local-gem

rhc-1.30.2依赖的gem包列表如下:

  • http://rubygems.org/downloads/archive-tar-minitar-0.5.2.gem
  • http://rubygems.org/downloads/commander-4.2.0.gem
  • http://rubygems.org/downloads/highline-1.6.21.gem
  • http://rubygems.org/downloads/httpclient-2.4.0.gem
  • http://rubygems.org/downloads/net-scp-1.2.1.gem
  • http://rubygems.org/downloads/net-ssh-2.9.1.gem
  • http://rubygems.org/downloads/net-ssh-gateway-1.2.0.gem
  • http://rubygems.org/downloads/net-ssh-multi-1.2.0.gem
  • http://rubygems.org/downloads/open4-1.3.4.gem
  • http://rubygems.org/downloads/rhc-1.30.2.gem

将上述gem文件下载至本地目录下,然后在该目录下执行

gem install rhc –local .\rhc-1.30.2.gem

执行成功时日志打印如下:

Successfully installed net-ssh-2.9.1
Successfully installed net-scp-1.2.1
Successfully installed net-ssh-gateway-1.2.0
Successfully installed net-ssh-multi-1.2.0
Successfully installed archive-tar-minitar-0.5.2
Successfully installed highline-1.6.21
Successfully installed commander-4.2.0
Successfully installed httpclient-2.4.0
Successfully installed open4-1.3.4
===========================================================================

If this is your first time installing the RHC tools, please run 'rhc setup'

===========================================================================
Successfully installed rhc-1.30.2
Parsing documentation for net-ssh-2.9.1
Installing ri documentation for net-ssh-2.9.1
Parsing documentation for net-scp-1.2.1
Installing ri documentation for net-scp-1.2.1
Parsing documentation for net-ssh-gateway-1.2.0
Installing ri documentation for net-ssh-gateway-1.2.0
Parsing documentation for net-ssh-multi-1.2.0
Installing ri documentation for net-ssh-multi-1.2.0
Parsing documentation for archive-tar-minitar-0.5.2
Installing ri documentation for archive-tar-minitar-0.5.2
Parsing documentation for highline-1.6.21
Installing ri documentation for highline-1.6.21
Parsing documentation for commander-4.2.0
Installing ri documentation for commander-4.2.0
Parsing documentation for httpclient-2.4.0
Installing ri documentation for httpclient-2.4.0
Parsing documentation for open4-1.3.4
Installing ri documentation for open4-1.3.4
Parsing documentation for rhc-1.30.2
Installing ri documentation for rhc-1.30.2
===========================================================================

If this is your first time installing the RHC tools, please run 'rhc setup'

===========================================================================
Successfully installed rhc-1.30.2
Parsing documentation for rhc-1.30.2
11 gems installed
最近的文章

提权小技巧整理

一、通常aspx的webshell的运行权限比asp的高二、把你的添加用户、开远程的程序更改成program.exe然后放到C盘根目录下会有意想不到的结果,前提是你得有能上传或者远程下载以及C盘有权限…

小技巧 提权继续阅读
更早的文章

北京小记一篇

6点醒来,在火车上,窗外满是雾霾,感觉不是一个好天心情非常好,和阔别多日的女友要见面了8点多,两人在宣武门地铁站在人堆中挣扎了一番后见了面,不顾众人的秀了一番恩爱简单吃了个早餐,便琢磨着去动物园转转,然后悲剧由此发生随着拥挤的人潮有进了TM的北京地铁,一边骂着票价贵一边往车上挤地铁开到西直门,妈蛋,悲剧发生了,旁边一妹子提醒我火车票掉地上了我蹲下捡起火车票,说我车票好好的放在口袋里怎么会掉到地上呢,下意识摸了下口袋大喊一声:卧槽,钱包被偷了。看了眼四周,除了漂亮的女友,都是一群面无表情,匆...…

beijing 北京继续阅读