Install VMC under Windows
- Install rubyinstaller-1.9.2-p290.exe from http://www.rubyinstaller.org (make sure to check the boxes to add the ruby directory to your command path)
- In console mode, Type: gem install vmc
If you are behind a firewall, you will get a nasty error message:
ERROR: Could not find a valid gem 'vmc' (>=0) in any repository - Install vmc gem through a proxy server, type:
gem install --http-proxy http://proxy.vmware.com:3128 (this proxy url is proxy server of your company) vmc - Tell Cloud Foundry which cloud you want to connect to. Type:
vmc target api.cloudfoundry.com (in general, you have to set the hosts info in your hosts document)
- the hosts document located in C:\Windows\System32\drivers\hosts
- add localhost name and its DNS, for example
- 11.111.111.22 api.cf-controller.test.com.tw
11.111.111.22 test.cf-controller.test.com.tw -
- To communicate with Cloud Foundry through a proxy server, set the environment variable "http_proxy". In the command window, type
- set http_proxy=http://proxy.vmware.com:3128 (this proxy url is proxy server of your company) vmc target api.cloudfoundry.com
- Login to Cloud Foundry
vmc login
Enter your email address and password - Create a simple Ruby application.
- c:\> md helloTest
- c:\> cd helloTest
- c:\helloTest\> copy nul helloTest.rb
- type the following sample code in helloTest.rb using a test editor :
- require 'sinatra'
get '/' do
"Hello from Cloud Foundry"
end
- Publish the application to the cloud. Type:
- c:\helloTest>vmc push helloTest (helloTest only without extension (.rb))
- Would you like to deploy from the current directory? [Yn]: y
- Application Deployed URL: 'helloTest.cf-controller.cht.com.tw'? y
- Detected a Sinatra Application, is this correct? [Yn]: y
- Memory Reservation [Default:128M] (64M, 128M, 256M, 512M or 1G)
- Creating Application: OK
- Would you like to bind any services to 'helloTest'? [yN]: n
- Uploading Application:
- Checking for available resources: OK
- Packing application: OK
- Uploading (0K): OK
- Push Status: OK
- Staging Application: OK
- modify C:\Windows\System32\drivers\hosts and add your application info:
- 11.111.111.22 helloTest.cf-controller.testcom.tw
- Launch a web browser and go to your Application Deployment URL (helloTest.cf-controller.testcom.tw)
Reference:
- http://cloud.dzone.com/news/world-your-oyster-installing
- http://support.cloudfoundry.com/entries/20425003-error-creating-war-file
- http://support.cloudfoundry.com/entries/20014132-vmc-push-failed-error-300-invalid-application-description
No comments:
Post a Comment