I’ve been using ruby for a while, but I’m know to both Java and JRuby.
In spite of that, I’m trying to use JRuby on the Google App Engine. It
is working well except when I try to use the “appengine-apis” gem.
My environment:
$ java -version
java version “1.6.0_14”
Java™ SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot™ 64-Bit Server VM (build 14.0-b16, mixed mode)
$ jruby -v
jruby 1.3.1 (ruby 1.8.6p287) (2009-06-15 2fd6c3d) (Java HotSpot™
64-Bit Server VM 1.6.0_14) [amd64-java]
$ sudo jruby -S gem install google-appengine
Successfully installed google-appengine-0.0.2
1 gem installed
Installing ri documentation for google-appengine-0.0.2…
Installing RDoc documentation for google-appengine-0.0.2…
$ sudo jruby -S gem install appengine-apis
Successfully installed appengine-apis-0.0.8
1 gem installed
Installing ri documentation for appengine-apis-0.0.8…
Installing RDoc documentation for appengine-apis-0.0.8…
Could not find main page README.rdoc
Could not find main page README.rdoc
Could not find main page README.rdoc
Could not find main page README.rdoc
Everything works splendidly! I can test my apps with dev_appserver.rb,
and I can publish them to the google cloud with appcfg.rb. However, when
I try to use any of the appengine APIs from the appengine-apis gem, it
falls to pieces. Here, I have merely added “require ‘appengine-apis’” to
my config.ru file.
$ dev_appserver.rb .
=> Booting DevAppServer
=> Press Ctrl-C to shutdown server
=> Generating configuration files
/usr/local/jruby-1.3.1/lib/ruby/site_ruby/1.8/builtin/javasupport/core_ext/object.rb:116:in
get_proxy_or_package_under_package': cannot load Java class com.google.appengine.api.urlfetch.URLFetchServiceFactory (NameError) from /usr/local/jruby-1.3.1/lib/ruby/site_ruby/1.8/builtin/javasupport/java.rb:51:in
method_missing’
from ./urlfetch.rb:5
from ./urlfetch.rb:31:in require' from /usr/local/jruby-1.3.1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require’
from ./nick-brown.rb:3
from ./nick-brown.rb:31:in require' from /usr/local/jruby-1.3.1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require’
from config.ru:4:in `generate_xml’
I suspect that there is some simple trick to making
com.google.appengine.api work properly, but I’m not seeing it due to my
lack of java and jruby skills. Any advice would be greatly appreciated.