Starting with CloudFoundry on Windows

UPDATE Nov 1, 2013: The new version of CloudFoundry API is ‘cf’ instead of ‘vmc’ and the target url is ‘https://api.run.pivotal.io’

Currently, I am using CloudFoundry to deploy my Grails applications in production and development on cloud. This post is how to configure CloudFoundry on Windows, so you can deploy application. Please, see another post for how to deploy Grails Apps using CloudFoundry or PHP Applications using AppFog

Step 1 – Installing Ruby Installer

You will need this to intall VMC – command line tool to communicate with CloudFoundry Cloud Controller

Go to Ruby Installer website and run executable to install Ruby Installer

Step 2 – Installing RubyGems

To install RubyGems, open command line with Ruby(Start->Programs->Ruby XXX-> Start Command Prompt with Ruby) and run the following command:

>gem update --system

This will install RubyGems

Step 3 -Install VMC

Open Command Line with Ruby like described avobe. Run the following command:

>gem install vmc

This will install VMC tool and with it you are able to run commands on the CoudFoundry Controller to deploy your apps. For that see the post – ‘Deploy WordPress App WordPress on Cloud using CloudFoundry’

Starting On Mac

For Mac you can skip the ‘Step1 –¬†Installing Ruby Installer’ as mac newest OS comes with the ruby installer. Otherwise, rest is the same from Mac as Windows

Issues

1. Environment variable ‘HOME’

We were getting following error:

non-absolute home
C:/DevTools/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/lib/cli/config.rb:92:in `expand_path'
C:/DevTools/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/lib/cli/config.rb:92:in `aliases'
C:/DevTools/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/lib/cli/runner.rb:427:in `process_aliases!'
C:/DevTools/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/lib/cli/runner.rb:460:in `run'
C:/DevTools/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/lib/cli/runner.rb:14:in `run'
C:/DevTools/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/bin/vmc:5:in `<top (required)>'
C:/DevTools/Ruby193/bin/vmc:23:in `load'
C:/DevTools/Ruby193/bin/vmc:23:in `<main>'

This happens if you set environment variable ‘HOME’ to something. Apparently, Ruby gems is using this variable, so by having it set to something causes the above error

Leave a Reply

Your email address will not be published. Required fields are marked *