The (1) works fine for me.
I'm trying to execute the (2) sample (Datastore) and this fails:
$ bundle install
$ rails server # webserver works fine, but when I get to any page I get...
If I need to pre-configure my Datastore access with some kind of credentials, I believe this should go in the README. From the error tyupe, looks like auth mechanism has changed lately.
Is this a bug or WAI? See attached errors (from backend and frontend):
server error for page:
Started GET "/" for 127.0.0.1 at 2017-04-08 13:36:48 +0200
Processing by BooksController#index as HTML
Completed 500 Internal Server Error in 1ms
RuntimeError (Could not load the default credentials. Browse to
https://developers.google.com/accounts/docs/application-default-credentials
for more information
):
app/models/book.rb:24:in dataset' app/models/book.rb:42:in
query'
app/controllers/books_controller.rb:20:in `index'
Rendered /home/riccardo/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_source.erb (2.3ms)
Rendered /home/riccardo/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.1ms)
Rendered /home/riccardo/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.5ms)
Rendered /home/riccardo/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (9.9ms)
Web error:
RuntimeError in BooksController#index
Could not load the default credentials. Browse to https://developers.google.com/accounts/docs/application-default-credentials for more information
Extracted source (around line #24):
# The dataset is used to create, read, update, and delete entity objects.
def self.dataset
@dataset ||= Google::Cloud::Datastore.new(
project: Rails.application.config.
database_configuration[Rails.env]["dataset_id"]
)