App Engine recently unveiled its second language: Java. This release includes an early look at our Java runtime, integration with Google Web Toolkit, and a Google Plugin for Eclipse, giving you an end-to-end Java solution for AJAX web applications. Our support for the Java language is still under development and we're eager to get your help and input. The Java runtime is now available for anyone to use, so please give it a try and send us your feedback.
- Get the full scoop in our blog post.
- Click over to YouTube to watch our Campfire One announcements.
- See our docs for other new features like cron support, database import, and access to firewalled data.
Here’s how to get rolling:
-
Install the gems
$ sudo gem install google-appengine - Assign an app identifier
Simply create an application at appspot.com,
we'll refer to that as my-app in this document. - Generate your rails app
$ rails my-app; cd my-app;
- Generate a rackup file
In the same folder, save this as config.ru.
require 'appengine-rack'
AppEngine::Rack.configure_app(
:application => 'my-app',
:version => 1 )
ENV['RAILS_ENV'] = AppEngine::Rack.environment
require 'config/environment'
run ActionController::Dispatcher.new - Check gem sources for datamapper
$ gem sources
Only when missing, add it like this...
$ sudo gem source -a http://gems.datamapper.org - Install gems into your app
$ appcfg.rb gem install rails dm-appengine
- Modify the Rails Initializer
Add the following to your config/environment.rb.
# Set DataMapper to use dm-appengine adapter
require 'dm-core'
DataMapper.setup(:default, "appengine://auto")
# Set Logger from appengine-apis, all environments
require 'appengine-apis/logger'
config.logger = AppEngine::Logger.new
# Skip frameworks you're not going to use.
config.frameworks -= [ :active_record ] - Run your app locally
$ dev_appserver.rb .
- Open up the console
$ appcfg.rb run -S irb
> require 'config/environment' - Deploy to App Engine
$ appcfg.rb update .
http://rails-primer.appspot.com/
No comments:
Post a Comment