Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Abhängigkeiten für Ruby-Anwendungen werden in einer Gemfile-Datei deklariert.
Beispiel:
source"https://rubygems.org"gem"rails"
In der flexiblen App Engine-Umgebung können Sie ein beliebiges Linux-kompatibles Ruby-Paket verwenden, einschließlich Pakete, die native (C) Erweiterungen erfordern.
Die Ruby-Laufzeit installiert automatisch alle Abhängigkeiten, die während der Bereitstellung in Ihrer Gemfile-Datei deklariert wurden.
Web-Framework installieren
Sie müssen ein Web-Framework verwenden, damit Ihre Anwendung Webanfragen verarbeiten kann.
Sie können ein beliebiges Ruby-Web-Framework einschließlich der folgenden verwenden:
Geben Sie in Ihrer app.yaml-Datei einen Startbefehl an, um ein bestimmtes Web-Framework zu verwenden:
runtime:rubyenv:flexentrypoint:railsserver
Cloud-Clientbibliotheken installieren
Die Cloud-Clientbibliothek für Ruby ist eine Clientbibliothek für den Zugriff auf Google Cloud -Dienste, die den von Ihnen zu schreibenden Boilerplate-Code erheblich reduziert. Die Bibliothek bietet API-Abstraktionen auf übergeordneter Ebene, sodass sie einfacher zu verstehen sind und Sie mehr Zeit für die Erstellung von Code haben, der für Sie von Bedeutung ist.
So installieren Sie die Bibliothek lokal:
geminstallgoogle-cloud
Die Clientbibliothek kann auch lokal automatisch die Authentifizierung mithilfe der Google Cloud CLI ausführen:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\u003cp\u003eRuby application dependencies are managed in a \u003ccode\u003eGemfile\u003c/code\u003e, which is automatically processed during deployment to install all required packages.\u003c/p\u003e\n"],["\u003cp\u003eThe App Engine flexible environment supports any Linux-compatible Ruby package, including those with native (C) extensions.\u003c/p\u003e\n"],["\u003cp\u003eA web framework is required to serve web requests, and popular options like Ruby on Rails, Sinatra, and Rack are supported.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eapp.yaml\u003c/code\u003e file must specify a startup command to indicate which web framework will be used by the application.\u003c/p\u003e\n"],["\u003cp\u003eThe Cloud Client Libraries for Ruby, installable via \u003ccode\u003egem install google-cloud\u003c/code\u003e, are available to simplify interactions with Google Cloud services and manage authentication.\u003c/p\u003e\n"]]],[],null,["# Specifying dependencies\n\nDependencies for Ruby applications are declared in a\n[`Gemfile`](https://bundler.io/v2.4/man/gemfile.5.html)\nfile.\n\nFor example: \n\n source \"https://rubygems.org\"\n\n gem \"rails\"\n\nYou can use any Linux-compatible Ruby package in the App Engine flexible\nenvironment, including packages that require native (C) extensions.\n\nThe Ruby runtime will [automatically install](/appengine/docs/flexible/ruby/runtime#dependencies) all\ndependencies declared in your `Gemfile` file during deployment.\n\nInstalling a web framework\n--------------------------\n\nYou'll need to use a web framework to enable your app to serve web requests.\nYou can use any Ruby web framework including the following:\n\n- [Ruby on Rails](http://rubyonrails.org/)\n- [Sinatra](http://www.sinatrarb.com/)\n- [Rack](http://rack.github.io/)\n\nTo use a particular web framework, specify a startup command in your `app.yaml`\nfile: \n\n runtime: ruby\n env: flex\n entrypoint: rails server\n\nInstalling the Cloud Client Libraries\n-------------------------------------\n\nThe [Cloud Client Libraries for Ruby](/ruby/docs/reference) is a client\nlibrary for accessing Google Cloud services that significantly reduces\nthe boilerplate code you have to write. The library provides high-level API\nabstractions so they're easier to understand and means you spend more time\ncreating code that matters to you.\n\nTo install the library locally: \n\n gem install google-cloud\n\nThe client library can automatically handle authentication for you locally as\nwell by using [Google Cloud CLI](/sdk/docs): \n\n gcloud auth login\n\nFor details on configuring Cloud Client Libraries for Ruby to handle authentication\nautomatically, see [Authenticate to Cloud services using client libraries](/docs/authentication/client-libraries)."]]