google-code-export / appengine-jruby

Automatically exported from code.google.com/p/appengine-jruby
0 stars 0 forks source link

load local_boot on console started #64

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

I added this to my ~/.irbrc
--
if defined?(:AppEngine)
   require "appengine-apis/local_boot"
end
--

Without this:
>> Comment.all
NativeException: java.lang.NullPointerException: No API environment is
registered for this thread.
        from
com/google/appengine/api/datastore/DatastoreApiHelper.java:67:in
`getCurrentAppId'
        from
com/google/appengine/api/datastore/DatastoreApiHelper.java:77:in
`getCurrentAppIdNamespace'

or type:
 require "appengine-apis/local_boot"
everytime.

Original issue reported on code.google.com by sasaki.t...@gmail.com on 12 Jan 2010 at 5:09

GoogleCodeExporter commented 9 years ago
to start console:
 appcfg.rb run script/console

Original comment by sasaki.t...@gmail.com on 12 Jan 2010 at 5:10

GoogleCodeExporter commented 9 years ago
add to it config/environments/development.rb may be better.
"console on development environment" need to load it,
but dev_appserver.rb doesn't.

Original comment by sasaki.t...@gmail.com on 12 Jan 2010 at 5:15

GoogleCodeExporter commented 9 years ago
today,
 appcfg.rb run -S irb -r config/environment
is better. I think.

Original comment by sasaki.t...@gmail.com on 14 Jan 2010 at 5:40

GoogleCodeExporter commented 9 years ago
I could not use "reload!" in "appcfg.rb run -S irb -r config/environment"
But I can use "reload!" in "appcfg.rb run script/console" with local_boot.

Original comment by sasaki.t...@gmail.com on 14 Jan 2010 at 9:31