Code Monkey home page Code Monkey logo

jruby-enginize's Introduction

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 [email protected] --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.

http://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

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

and setting a new default available at

http://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.

jruby-enginize's People

Stargazers

 avatar Ruby "THE Hero"  Shot  avatar  avatar Kevin Hutson avatar Jan Ulbrich avatar  avatar Petr Vostřel avatar Adam Strickland avatar  avatar Collin Reisdorf avatar Anthony Lai avatar Jeremy Hulick avatar Jan Berkel avatar John Woodell avatar phon xay avatar Paul Gallagher avatar Maximilian Schoefmann avatar Bernd Jünger avatar Rainux Luo avatar  avatar David Ruan avatar Stephane Bellity avatar Joc avatar Winston avatar Colin Surprenant avatar Rich Manalang avatar Nick Sieger avatar

Watchers

 avatar

Forkers

jhulick

jruby-enginize's Issues

problems with running server

Hi,

I was following your instructions but get the following error when running
sudo rake appengine:run

SEVERE: [1257339877609000] javax.servlet.ServletContext log: unable to create shared application instance
org.jruby.rack.RackInitializationException: no such file to load -- rubygems
        from config.ru:2

I have recently installed JRuby 1.4 ( the latest one )

Incomplete README.rdoc?

Hi there,

I need some clues about how to run jruby-enginize.

Here is some info about my efforts:

Sat Sep 26 20:12 /pt/b/gae maco$ gem sources -a http://gems.github.com
gem sources -a http://gems.github.com
http://gems.github.com added to sources
Sat Sep 26 22:53 /pt/b/gae maco$ gem install ulbrich-jruby-enginize
Successfully installed ulbrich-jruby-enginize-0.7.2
1 gem installed
Installing ri documentation for ulbrich-jruby-enginize-0.7.2...
Updating ri class cache with 2393 classes...
Installing RDoc documentation for ulbrich-jruby-enginize-0.7.2...
Sat Sep 26 22:53 /pt/b/gae maco$ gem install google-appengine
Successfully installed google-appengine-0.0.4
1 gem installed
Installing ri documentation for google-appengine-0.0.4...
Installing RDoc documentation for google-appengine-0.0.4...
Sat Sep 26 22:54 /pt/b/gae maco$ gem list|grp engine
appengine-jruby-jars (0.0.4)
appengine-rack (0.0.3)
appengine-sdk (1.2.5)
appengine-tools (0.0.4)
google-appengine (0.0.4)
Sat Sep 26 22:54 /pt/b/gae maco$ gem list|grp jruby
appengine-jruby-jars (0.0.4)
ulbrich-jruby-enginize (0.7.2)

Sat Sep 26 22:56 /pt/b/gae/enginize10 maco$ jruby-enginize
!!AppEngine SDK missing. Please retry after installing.
Sat Sep 26 22:56 /pt/b/gae/enginize10 maco$

The instructions seem so simple.

Perhaps they are incomplete?

-Audrey

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.