• 首页
  • mac
  • gem install rhc mac环境安装 openshift 连接工具 rhc

gem install rhc mac环境安装 openshift 连接工具 rhc

openshift.jpg

什么是 openShift

openshift免费空间是Red Hat的平台即服务的云计算平台(PaaS)

支持Java,PHP,Python,Perl,Ruby以及MySQL Database,phpMyAdmin,MongoDB NoSQL Database,Cron 1.4等应用

OpenShift服务器采用的是AmazonEC2数据中心,月流量不限制,且支持绑定顶级域名

目前Red Hat的OpenShift 上可以免费创建三个app,提供512MB内存和1G 存储空间,OpenShift免费空间的稳定性是有目共睹的

该空间在2012年十大优秀免费空间中排名榜首,虽然到了2013年十大免费空间中排名跌至第三名

以后会推出一系列关于 openShift 的应用的文章

今天和大家分享的 mac 环境下如何安装 rhc

什么是rhc

rhc 是OpenShift官方客户端连接工具

rhc 是ruby 写的一个包,所以我们需要 gem 来安装此包.

gem 安装 rhc

➜  /Users/zhangzhi  >gem install rhc

然后报错:


➜  /Users/zhangzhi  >gem install rhc
ERROR:  Could not find a valid gem 'rhc' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - Errno::ECONNRESET: Connection reset by peer - SSL_connect (https://rubygems.org/latest_specs.4.8.gz)
          

上面的错误是网络导致,伟大的"墙"也不愧是是世界"文明"古迹了…

看来我们需要把 gem 源切换到国内镜像源,首选淘宝,每天更新一次,保持一致.

➜  /Users/zhangzhi  >sudo gem sources -a https://ruby.taobao.org/
https://ruby.taobao.org/ added to sources

上面提示加入源成功!

然后我们安装 rhc

➜  /Users/zhangzhi  >gem install rhc
Fetching: net-ssh-2.9.2.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

上面错误提示 gem 在安装 rhc 时,写入文件夹权限受限制,看来我们需要使用 root 权限

➜  /Users/zhangzhi  >sudo gem install rhc
Fetching: net-ssh-2.9.2.gem (100%)
Successfully installed net-ssh-2.9.2
Fetching: net-scp-1.2.1.gem (100%)
Successfully installed net-scp-1.2.1
Fetching: net-ssh-gateway-1.2.0.gem (100%)
Successfully installed net-ssh-gateway-1.2.0
Fetching: net-ssh-multi-1.2.1.gem (100%)
Successfully installed net-ssh-multi-1.2.1
Fetching: archive-tar-minitar-0.5.2.gem (100%)
Successfully installed archive-tar-minitar-0.5.2
Fetching: highline-1.6.21.gem (100%)
Successfully installed highline-1.6.21
Fetching: commander-4.2.1.gem (100%)
Successfully installed commander-4.2.1
Fetching: httpclient-2.6.0.1.gem (100%)
Successfully installed httpclient-2.6.0.1
Fetching: open4-1.3.4.gem (100%)
Successfully installed open4-1.3.4
Fetching: rhc-1.37.1.gem (100%)
===========================================================================

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

===========================================================================
Successfully installed rhc-1.37.1
Parsing documentation for net-ssh-2.9.2
Installing ri documentation for net-ssh-2.9.2
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.1
Installing ri documentation for net-ssh-multi-1.2.1
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.1
Installing ri documentation for commander-4.2.1
Parsing documentation for httpclient-2.6.0.1
Installing ri documentation for httpclient-2.6.0.1
Parsing documentation for open4-1.3.4
Installing ri documentation for open4-1.3.4
Parsing documentation for rhc-1.37.1
Installing ri documentation for rhc-1.37.1
10 gems installed
➜  /Users/zhangzhi  >

安装成功

出自:gem install rhc mac环境安装 openshift 连接工具 rhc



回到顶部