Specifying dependencies

Dependencies for Ruby applications are declared in a Gemfile file.

For example:

source"https://rubygems.org"
gem"rails"

You can use any Linux-compatible Ruby package in the App Engine flexible environment, including packages that require native (C) extensions.

The Ruby runtime will automatically install all dependencies declared in your Gemfile file during deployment.

Installing a web framework

You'll need to use a web framework to enable your app to serve web requests. You can use any Ruby web framework including the following:

To use a particular web framework, specify a startup command in your app.yaml file:

runtime:ruby
env:flex
entrypoint:railsserver

Installing the Cloud Client Libraries

The Cloud Client Libraries for Ruby is a client library for accessing Google Cloud services that significantly reduces the boilerplate code you have to write. The library provides high-level API abstractions so they're easier to understand and means you spend more time creating code that matters to you.

To install the library locally:

geminstallgoogle-cloud

The client library can automatically handle authentication for you locally as well by using Google Cloud CLI:

gcloudauthlogin

For details on configuring Cloud Client Libraries for Ruby to handle authentication automatically, see Authenticate to Cloud services using client libraries.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年12月22日 UTC.