问题
After Executing > rhc setup
and then entering my hostname i always get this error message
Steps that i've done:
1- installed Ruby 1.9.3
2- installed rhc using gem gem install rhc
3- Executed > rhc setup
回答1:
It seems that this is some kind of bug.
But, there is another way to manually generate SSH public-private key pairs and upload them to OpenShift
1- Generate new SSH keys
C:\> ssh-keygen
It will ask you where to save the key files just press "Enter" -> this will generate key-pairs with name "id_rsa" in "C:\Users\YOU\.ssh" also Press Enter when asked for passphrase to keep it empty
2- Upload you Public Key to OpenShift
C:/>rhc sshkey add id_rsa C:\Users\YOU\.ssh\id_rsa.pub
It will then ask you for your credentials on OpenShift, once done your public key is now uploaded to OpenShift
3- Configuring SSH to use the Generated private key when connecting to your APP
a- Make sure you have an environment variable "HOME" pointing to "C:/Users/YOU/.ssh", if not create one
b- open "C:/Users/YOU/.ssh/" if you find config file open it , if not create one by running the following command:
touch config
Now add the following lines to config file:
Host ChooseAName
HostName APPName-NameSpace.rhcloud.com
IdentityFile ~\.ssh\id_rsa.pub
save and close
4- Now Connecting to your App:
First, Get the command that enables you to connect remotely to your app on rhcloud server , you can get it using the OpenShift web console
enter that to you command line and you will be connected trough a secure shell to you APP on rhcloud
回答2:
In my case, it was because I was typing
rhc setup --server=my_app_domain
but in fact, the relevant server was the Openshift Enterprise server that was hosting my domain. When I used this server, it worked fine.
来源:https://stackoverflow.com/questions/34975634/error-executing-rhc-setup-an-unexpected-error-occurred-invalid-character-at