Skip to content

Latest commit

 

History

History
63 lines (51 loc) · 2.07 KB

README.md

File metadata and controls

63 lines (51 loc) · 2.07 KB

This is a proof of concept to demonstrate we can:

  • run a sinatra app with jRuby
  • run the app in a Java servlet container (Tomcat)
  • run the app in Google's Appengine

Contains a small ruby sinatra application under small_app.

Make sure you have a working JDK in your machine before starting!

Some prior experience with Java, Appengine and Ruby would be advisable.

Sinatra with jRuby

  • Install the ruby version
  • Install bundler
gem install bundler
cd small_app
bundle

Run under Tomcat

gem install warbler
cd small_app
warble

Now our ruby app is packaged in a format suitable for Java containers.

Run under Appengine

  • Download the SDK
  • Uncompress anywhere
  • Uncompress the war file inside appengine's directory, or symlink to the uncompressed war that tomcat created in webapps/small_app.war

Appengine applications need an appengine-web.xml. Create one next to web.xml in your WEB-INF war folder with the following contents:

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
  <application>YOUR_APP_NAME</application>
  <version>1</version>
  <threadsafe>true</threadsafe>
</appengine-web-app>
  • Start the appengine server bin/dev_appserver.sh small_app
  • Deploy to appengine production servers. You'll have to create an app first. bin/appcfg.sh update small_app