安裝 rhc 於 Windows 7
安裝 Ruby
- Install Ruby with RubyInstaller : Official Website
- during the installation you can accept all of the defaults
- it is mandatory that you select the Add Ruby executables to your PATH check box in order to run Ruby from the command line
- Use command 'ruby -v' to check the version of ruby and whether it works correctly or not
Microsoft Windows [版本 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\System32>ruby -v
ruby 1.9.3p551 (2014-11-13) [i386-mingw32]
註解 |
---|
建議安裝 ruby 1.9.3 版本 |
安裝 Git 版本控制軟體
- 安裝 Git for Windows (link),透過 Git 能夠進行分散式開發且作為與 OpenShift 服務進行版本控管的依據
- 安裝完後,預設會直接將 git Path 加入環境變數中,可以透過命令提式字元進行查詢
- Use command 'git --version' to check the version of git and whether it works correctly or not
Microsoft Windows [版本 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\System32>git --version
git version 2.6.4.windows.1
安裝及設定 OpenShift gem
方法一: It might go wrong.
Installing using update packages : https://gist.github.com/luislavena/f064211759ee0f806c88
gem install the software by command line (assume the software installation file is under C:)
C:\Windows\System32>gem install --local C:\rubygems-update-1.8.30.gem
- update the rubygem
C:\Windows\System32>update_rubygems --no-ri --no-rdoc
- 方法二: directly install rubygem and update
C:\Windows\System32>gem install rubygems-update
C:\Windows\System32>update_rubygems
C:\Windows\System32>gem update --system
安裝與啟動 rhc
- 安裝 rhc
C:\Windows\System32>gem install rhc
- 啟動 rhc
C:\Windows\System32>rhc setup
設定 rhc
輸入 OpenShift Server hostname : (預設是正確的,可以直接按 enter)
Enter the server hostname: |openshift.redhat.com|
登入 OpenShift 的帳號,以 [email protected] 為例
Login to openshift.redhat.com: [email protected]
輸入密碼 : 密碼為不可見,輸入中也不會出現任何符號
Password:
是否產生一組新的 token : 若是第一次透過 SSH 登入 OpenShift,回 yes;若非第一次登入,則應已有 SSH public 及 Private Key,回 no。
Generate a token now? (yes|no)
若是回 "yes",則會產生一組 ssh 的 public key (id_rsa.pub) 與 private key,一般而言 Public key 會放在 C:/Users/ucer/.ssh/id_rsa.pub
No SSH keys were found. We will generate a pair of keys for you. Created: C:/Users/ucer/.ssh/id_rsa.pub
最後則是將 public key 上傳至 OpenShift server,回答 yes
Your public SSH key must be uploaded to the OpenShift server to access code. Upload now? (yes|no)