If you are creating a new function, see the Console Quickstart on Cloud Run. The content on this page only applies to existing legacy functions created with the Cloud Functions v1 API.
Stay organized with collections
Save and categorize content based on your preferences.
The Ruby Runtime
Overview
Your Cloud Run function runs in an environment consisting of an operating
system version plus add-on packages, language support, and
the Functions Framework library that supports and invokes your function.
This environment is identified by the language version, and is known as the
runtime.
Cloud Run functions supports several versions of Ruby, listed on the
Runtime support page. You can
select the preferred Ruby runtime for your function during deployment.
gcloud
If you're using the Google Cloud CLI, specify the runtime
by using the --runtime parameter. NAME specifies the
function name. For example:
For Cloud Run functions to find your function's definition, your
source code must follow a specific structure. See
Writing Cloud Run functions
for more information.
Function preparation
You can prepare a function directly from the Google Cloud console or write it on
your local machine and upload it. To prepare your local machine for Ruby
development, see Setting up a Ruby development environment.
The library that invokes your function is the
Ruby Functions Framework.
Specifying dependencies
You can specify dependencies for your function by adding them to a project file.
For more information, see Specifying dependencies in
Ruby.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-17 UTC."],[[["Cloud Run functions utilize a runtime environment that includes the operating system, language support, and the Functions Framework library, with the specific environment determined by the selected Ruby version."],["You can choose from several supported Ruby runtimes when deploying your Cloud Run function, with the available versions listed on the Runtime support page."],["When using the Google Cloud CLI, the `--runtime` parameter allows you to specify the desired Ruby runtime for your function during deployment."],["Cloud Run functions require a specific source code structure for the system to locate your function's definition; therefore, it's imperative to follow the guidance given in the Writing Cloud Run functions documentation."],["Ruby supports only CloudEvent functions as event-driven function types, and you can manage dependencies for your function by adding them to a designated project file, as detailed in the Specifying dependencies in Ruby guide."]]],[]]