RUBY ON GOOGLE CLOUD PLATFORM

Try It Free View Documentation

Ruby tools to build cloud-native apps, deploy at scale, and analyze data

  • Build planet-scale web apps and APIs
  • Use Google’s machine learning APIs with native library support
  • Run containerized applications at scale
  • Orchestrate infrastructure with Puppet and Chef
LOVINGLY-CRAFTED RUBY GEMS

Take advantage of our APIs and services using the Google Cloud Ruby Gems and test run our code samples.

1
Install
gem install google-cloud-storage
2
Set up a Cloud Platform Console project
  1. Faça login na sua Conta do Google.

    Se você ainda não tiver uma, inscreva-se.

  2. Configurar um projeto do Console do GCP.

    Configurar um projeto

    Clique para:

    • criar ou selecionar um projeto;
    • ativar a(s) Cloud Storage API necessária(s) para o projeto.
    • criar uma conta de serviço;
    • fazer o download de uma chave privada como JSON.

    É possível ver e gerenciar esses recursos a qualquer momento no Console do GCP.

3
Write your code
# bucket_name       = "Your Google Cloud Storage bucket name"
# local_file_path   = "Path to local file to upload"
# storage_file_path = "Path to store the file in Google Cloud Storage"

require "google/cloud/storage"

storage = Google::Cloud::Storage.new
bucket  = storage.bucket bucket_name

file = bucket.create_file local_file_path, storage_file_path

puts "Uploaded #{file.name}"
RUBY QUICK STARTS
QUICKLY FIND AND DEBUG ISSUES

Google Cloud operations products provide powerful monitoring, logging, and diagnostics. It equips you with insight into the health, performance, and availability of cloud-powered applications, enabling you to find and fix issues faster.

Operations products
Unified monitoring, logging, and diagnostics for applications on Google Cloud and AWS.
Error Reporting
A walk through of getting an error alert and investigating the error in the Cloud Console.
Monitor, diagnose, and fix
In this video, Aja Hammerly uses Cloud Monitoring, Cloud Logging, Error Reporting, Cloud Debugger, and Cloud Trace to find and fix some subtle errors in an example app.
Learn more
RUBY ON GCP COMMUNITIES

Got something to say? Join our community to ask questions, or just chat with the experts at Google who help build Ruby for Google Cloud Platform.