-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rails tutorial with gem "google-cloud" #910
Comments
Hi @dhirajbajaj, did you try this in-depth tutorial? https://cloud.google.com/ruby/getting-started/tutorial-app You can chose to use Cloud Datastore on the second page. It also covers Storage, Logging and Pub/Sub. |
We recently changed the name of this library from "gcloud" to "google-cloud" and the tutorial needs to be updated, but all of the examples should work with the current version of this library. |
Yes @quartzmo, i followed bookshelf tutorial, and i got Google::Cloud API error with cloud-data-store example which led me to fix it with setting up credentials and emulator for local env. It makes me to think that i am missing something when deploying. Thus the issue. :) |
I don't know of any other resources, but I think it would be great to document what you experienced in detail here on this issue, for three reasons:
Can you back up to where you first got an error while following the tutorial, and paste it here, along with any environmental details you can capture (actual gem versions)? Leave out anything sensitive like your auth details of course. |
@dhirajbajaj We have an example Rails app using 'google-cloud-datastore' located here which works on Heroku. |
@dhirajbajaj Sounds good, thank you! Once you've posted here, I'll try to reproduce your issue as well. |
@dhirajbajaj OK, perfect. At one point we did have the Agrimatics Rails app running on the App Engine Managed VMs (I think it is called Flexible Environment now) so I might be able to help. |
Some background: I am still exploring and coming from quick deployment mindset like capistrano, rubber to ec2 with clarity on configs, or to heroku setting up config/postgres service from cli. I started with ruby documentation/quickstarts, installed cloud sdk and then moved to bookshelf tutorial to try it out. I ran the example with the instructions in the tute :
At this point, i had no clarity about setting up credentials, as it isn't mentioned in the tutorial docs, plus service account details and setting up emulator with beta components required for local development. It came to me after digging from issues like : API error issue and also changing to google-cloud gem with @bmclean solution. Also, got some other commit errors:
I set up the emulator, and credentials to setup env variables and cloud-data-store to get it running on local env using:
While this works for local env. When i deploy this to production, it raises 503 server error. The log shows 500/301 raised by _ah/health VMruntimehealthchecker. so clearly there is some issue with code/config. I will try to fix it. Any pointers will be great. Some suggestion to tutorial would be to add :
Hope you find it useful. @bmclean Please share. |
Regarding _ah/health, take a look at the Procfile from 6-task-queueing in getting-started-ruby. You need something that responds to those health requests, otherwise the instance will be classified as unhealthy and it won't receive any requests. The example uses
with a route like so:
If you are fighting with 301 redirects also take a look at this issue related to using SSL with Rails on the Flexible Environment. We had to disable SSL to get the Rails app to run. |
@dhirajbajaj Thank you, this is great. I will try to follow along and reproduce today. Do you have any feedback on our google-cloud-datastore Authentication docs? And did you try connecting locally to Cloud Datastore (not the emulator) using just google-cloud-datastore? You could even do this outside of Rails, in IRB for example. |
@bmclean Thanks i will try it out. 👍 @quartzmo Just feel that authentication docs should be to be linked in the tutorial in prerequisite section to cloud-data-store or much better to include the setup step in the tutorial. Yes, using only gem "google-cloud-datastore" runs in IRB. I tried it. |
This and your other bullet points, above, are valuable feedback for the authors of the tutorial, and we will do what we can to bring it to their attention. As far as I know the tutorial is not open-source.
The sample application is open-source, so I assume the best way to update the gem name(s) from Is there anything more we can do within the scope of this project? If not, can you close the issue? |
@bmclean Like usual, thank you!!! |
Thank you @dhirajbajaj for creating the issue for the Bookshelf tutorial, hopefully it will be updated soon with our new library and gem name(s). Can I close this issue now? |
Closing, kudos to @bmclean. |
Thanks @quartzmo! |
Hi all,
I have been exploring GAE for rails and couldn't find a appropriate tutorial for clarity.
Either way, i am left a bit confused about using datastore, storage, service accounts, keyfile.json, setting up emulator, gem "gcloud" / "google-cloud" etc.
Can anyone share a repo or tutorial that can helps to test and get running quickly with datastore and other services based on the concept.
The text was updated successfully, but these errors were encountered: