Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A generator for Google AppEngine compliant JRuby applications.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 lib
Octocat-spinner-32 templates
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 jruby-enginize.gemspec
README.rdoc

JRuby-Enginize

About

JRuby-Enginize is a generator for Google AppEngine compliant JRuby applications. The generator currently supports Sinatra and Merb with more frameworks to come in the future. If you want to learn more about Google AppEngine, go to code.google.com/appengine and have a look at the tutorials. For more about JRuby, please go to www.codehaus.org and see what's up running Ruby applications on a Java VM.

The Google people work hard to make JRuby easier to deploy with each release of their tools, so don't blindly trust all those blog posts and samples you'll find but use the newest version of jruby-enginize and have a look at the Wiki page of the Google AppEngine JRuby tools (code.google.com/p/appengine-jruby/wiki/GettingStarted) to learn about the details beyond.

If you used JRuby-Enginize before, you will note two bigger changes:

  • There is no need for a separate JRuby installation anymore, as the google-appengine gem does that for you.

  • Gem handling changed as Google now uses bundler and all required gems have to be registered in a new file called “Gemfile”. These gems are loaded on the fly when you call “rake appengine:run” or “rake appengine:deploy”. Quite elegant…

Installation

These are the steps for installing the Google tools plus JRuby-Enginize running on top of it to streamline your first steps:

sudo gem sources -a http://gemcutter.org  # Only needed once!
sudo gem install google-appengine
sudo gem install jruby-enginize

!!Warning: As Github cancelled gem support, we moved the gem from Github.com to Gemcutter.org. If you install from Github, you will not get the newest version! See gemcutter.org/gems/jruby-enginize for details.

You also need an Google AppEngine account to actually publish your code. Without account you can still play around with the tools and run applications locally.

Using jruby-enginize

JRuby-Enginize includes is a single executable named jruby-enginize which is inspired by the rails tool for generating Rails applications. So just call

jruby-enginize

and have a look at the options.

Here are the steps for creating and deploying a new Sinatra application:

  • Register with Google AppEngine and create a new application ID.

  • Generate your application with that new ID as directory name and the e-mail address of your Google account. Optionally choose a template (“sinatra” or “merb” for now).

    Sample:

    jruby-enginize --email john@doe.com --template sinatra jruby-enginize

  • Go to the new directory

  • Learn about the available rake tasks

    rake --tasks

  • Try out your application locally:

    rake appengine:run

    !!Attention: Whenever you want to require additional gems, be sure to add them to the bundler configuration in Gemfile instead of using jgem as the Google toole maintains a local repository per project and bundle the files to upload from that information.

  • Deploy the application:

    rake appengine:deploy

    The first time you deploy your application, you will be asked for e-mail and password to confirm your upload to the server.

You can repeat the deployment whenever you want. Be sure to set the version number in the AppEngine::Rack.configure_app part of config.ru to a new value, when you are experimenting with an unstable version and don't want to risk your users getting exceptions.

You can try the new version by opening e.g.

3.latest.jruby-enginize.appspot.com

and replacing “3” with the version number you want to run.

Switch the application to the new version as default (stable version) by opening

appengine.google.com/deployment?&app_id=jruby-enginize

and setting a new default available at

jruby-enginize.appspot.com

A small README with these and a few more application specific hints is generated along with the source code. Have fun.

Copyright & License

Copyright © 2009 Holtzbrinck Digital GmbH, Jan Ulbrich

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Something went wrong with that request. Please try again.