Deploy a Framework Friday #1 with Ruby and Sinatra

Alright, just for fun I’m kicking off a new blog series. I’m going to publish a new “Deploy a Framework Friday” each week for about the next, well, bunch of weeks. There are a TON of frameworks that are available on PaaS Technologies.

This first entry I’m going to implement a simple Sinatra app with Ruby. Nothing fancy, simply a hello world and the respective deployment to a Cloud Foundry PaaS.

First, let’s whip out the super complex code (right, this isn’t complex, I just like sarcasm). The hello.rb file I created.

require 'sinatra'

get '/' do
  "Hello World!"
end

get '/route' do
  "Hello from a route URI!"
end

Next add a Gemfile & respective Gemfile.lock as such.

Gemfile

source "http://rubygems.org"
gem 'sinatra'

Gemfile.lock

GEM
  remote: http://rubygems.org/
  specs:
    rack (1.4.1)
    rack-protection (1.2.0)
      rack
    sinatra (1.3.2)
      rack (~> 1.3, >= 1.3.6)
      rack-protection (~> 1.2)
      tilt (~> 1.3, >= 1.3.3)
    tilt (1.3.3)

PLATFORMS
  ruby

DEPENDENCIES
  sinatra

Then deploy using the Cloud Foundry VMC.

vmc push

If you’ve forgotten, be sure to target and login first.

vmc target api.ironfoundry.me
vmc login

That does it. Yeah, not a whole lot to get started working on a Sinatra Project. For more information on Sinatra check out the main web presence here http://www.sinatrarb.com/.

For more information on Cloud Foundry or Iron Foundry click on the respective link.

For the code sample, check out the working “paasIt” code repo on Github.

Next week I’ll do a baseline ASP.NET MVC 4 Application and get it deployed.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s