« Return to Thread: Google App Engine Rails Template
I haven't played with it lately so I need to recall..
Well, first of all my dev environment is not a real AppEngine setup,
it's plain JRuby/Rails plus Datastore. That's all I have used so far (no
memcache or mailer). One thing you need to do is require the
appengine-api-1.0-sdk-1.2.1.jar to make the AppEngine stuff available.
I've put the jar in the lib folder and require it in config/development.rb.
I think that's all. By the way, I used this example as project template:
http://github.com/nicksieger/jruby-rack/tree/bb907c03c48eb999e7d099068245b91eeda545bf/examples/rails
I hope this helps!
> <mailto:chr.seiler@...>>
Carson Welsh wrote:
>
> Hi Christian
>
> Thanks for the code sample.
>
> I am very eager to use a standard Ruby development environment for App
> Engine without restarts as you have described.
>
> I have spent several hours trying to use your code sample to configure
> a Rails project with GAE but so far have been unsuccessful.
>
> Have you made any other significant changes to your Rails app besides
> what you mentioned?
>
> Thanks,
> Carson
>
>
>
>
>
> From: *Christian Seiler* <chr.seiler@...
> Date: Mon, Jun 15, 2009 at 5:37 AM> To: user@... <mailto:user@...>
>
>
> My workaround in development mode so far: Simply using Webrick as
> usual
> plus setting up the datastore in the controller
> (application_controller.rb).
>
> if Rails.env=='development'
> before_filter :setup_datastore
> after_filter :teardown_datastore
> end
>
> protected
>
> if Rails.env=='development'
> import com.google.apphosting.api.ApiProxy
> import
> com.google.appengine.api.datastore.dev.LocalDatastoreService
> import com.google.appengine.tools.development.ApiProxyLocalImpl
>
> class DevEnvironment
> include ApiProxy::Environment
> def app_id
> 'Dev Environment'
> end
> end
>
> def setup_datastore
> ApiProxy.environment_for_current_thread = DevEnvironment.new
> ApiProxy.delegate = Class.new(ApiProxyLocalImpl).new
> java.io.File.new('.')
> #ApiProxy.delegate.set_property
> LocalDatastoreService::NO_STORAGE_PROPERTY, 'true'
> end
>
> def teardown_datastore
> #ApiProxy.delegate.get_service('datastore_v3').clear_profiles
> ApiProxy.delegate = nil
> ApiProxy.environment_for_current_thread = nil
> end
> end
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
« Return to Thread: Google App Engine Rails Template
| Free embeddable forum powered by Nabble | Forum Help |