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: rails server
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:
gem install google-cloud
The client library can automatically handle authentication for you locally as well by using Google Cloud CLI:
gcloud auth login
For details on configuring Cloud Client Libraries for Ruby to handle authentication automatically, see Authenticate to Cloud services using client libraries.