爲了啓動我在openshift的angular應用

在Windows環境下搭建OpenShift環境,安裝客戶端工具rhc,首先須要安裝Ruby和Git,參閱https://developers.openshift.com/en/getting-started-client-tools.html#windowshtml

在正確安裝Ruby和Git以後,使用RubyGems包管理器(Ruby內置)安裝OpenShift的客戶端工具rhc。python

官方提供的方式爲:gem install rhc,但多是網絡緣由所致,執行命令後提示錯誤信息:git

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)github

參閱StackOverFlow的一個解答:http://stackoverflow.com/questions/19745960/unable-to-install-any-gem-by-ruby-in-windowsweb

「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」sql

問題仍然沒有解決。數據庫

實際上,gem install支持本地方式安裝,即將gem包下載到本地後再執行gem install --local,參閱http://stackoverflow.com/questions/220176/how-can-i-install-a-local-gemwindows

rhc-1.30.2依賴的gem包列表以下:ruby

  • 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

原文地址http://bookshadow.com/weblog/2014/09/19/local-install-openshift-rhc-for-windows/

後來好不容易能在線gem install rhc了,可是一rhc setup就報錯,想起來ruby devkit沒裝

其實就在rubyInstaller的下面。另外我從前雖然在mac下,也是直接讓eclipse去發佈maven項目的,那樣就不用rhc命令行這麼麻煩。

還有因爲懷疑ruby版本的問題,gem install pik來代替rvm查看和切換ruby版本。

還有爲了follow人家的tornado與angular項目,把python的pip也裝了。

事已至此,乾脆把個人createjs項目就放在python後臺上面吧:

rhc create-app createjs python-2.7 postgresql-9.2 --from-code=https://github.com/haimingpro/createjs.git

postgresql-9.2 那截我刪了,暫時不想要數據庫了,況且仍是個我沒聽過的,數據庫和Jenkins均可之後面加,不像後臺得拆掉重建。。

然而ruby卸載了重裝了,devkit也成功有效的工做着,仍是setup不了rhc。

最後仍是這篇文章救了我!

C:\Ruby23-x64\devkit>rhc setup
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/commander-4.2.0/lib/commander/user_interaction.rb:328: warning: constant ::
TimeoutError is deprecated OpenShift Client Tools (RHC) Setup Wizard This wizard will help you upload your SSH keys, set your application namespace, and check that other programs like Git are properly installed. If you have your own OpenShift server, you can specify it now. Just hit enter to use the server for OpenShift Online: openshift.redhat.com. Enter the server hostname: |openshift.redhat.com| Interrupted 終止批處理操做嗎(Y/N)?

說到底仍是編譯的 Ruby 2.3.0 缺乏 openssl可是make這種解決方式不適合windows,

說白了裝一個名叫net-ssh的gem藥到病除。

相關文章
相關標籤/搜索