Bundler에는 알려진 호환성 문제가 있습니다.
애플리케이션에서 Bundler를 사용하는 경우 Ruby 및 Rubygems와의 다양한 호환성 문제로 인해 지원되는 두 버전 중 하나를 사용하도록 빌드된 앱에서 Gemfile.lock을 업데이트합니다.
BUNDLED WITH에서 Bundler 1.* 및 2.*를 사용하는 모든 애플리케이션은 Bundler 1.17.3과 2.3.15를 사용하도록 정규화됩니다.
진입점 지정
Procfile 사용
Procfile을 사용하여 컨테이너가 시작될 때 실행되는 명령어인 진입점을 지정할 수 있습니다.
예를 들어 앱 루트에 있는 Procfile에서 다음을 사용합니다.
web:rubymain.rb
Ruby 빌드팩은 ruby main.rb 명령어를 빌드된 컨테이너의 진입점으로 사용합니다.
기본적으로 Procfile의 web 대상이 사용됩니다.
다른 진입점을 사용하려면 Procfile과 다른 대상을 인수로 지정하면 됩니다.
web: ruby main.rb
custom: ruby custom.rb가 포함된 Procfile을 사용합니다.
커스텀 Procfile 대상을 인수로 전달하여 사용할 수 있습니다.
bash
pack build --builder=gcr.io/buildpacks/builder \
sample-ruby \
--entrypoint=custom
GOOGLE_ENTRYPOINT 사용
Procfile을 사용하지 않거나 Procfile을 재정의하려면 GOOGLE_ENTRYPOINT 환경 변수를 사용하여 진입점을 지정하면 됩니다. 예를 들면 다음과 같습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eRuby buildpacks support the current and Active LTS releases of Ruby, and older versions are available but may not be actively maintained.\u003c/p\u003e\n"],["\u003cp\u003eIf a \u003ccode\u003eGemfile.lock\u003c/code\u003e file exists, the Ruby version specified within it will be automatically used, and the \u003ccode\u003eGOOGLE_RUNTIME_VERSION\u003c/code\u003e environment variable will be ignored if bundler is used.\u003c/p\u003e\n"],["\u003cp\u003eIf bundler is not in use, you can specify the Ruby version using the \u003ccode\u003eGOOGLE_RUNTIME_VERSION\u003c/code\u003e environment variable, either directly or in a \u003ccode\u003eproject.toml\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003eProcfile\u003c/code\u003e can be used to define an entrypoint for your application, with the \u003ccode\u003eweb\u003c/code\u003e target being the default, or a different target can be selected via the command line.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGOOGLE_ENTRYPOINT\u003c/code\u003e environment variable can override any entrypoint specified in a \u003ccode\u003eProcfile\u003c/code\u003e or be used as an entrypoint if no \u003ccode\u003eProcfile\u003c/code\u003e exists.\u003c/p\u003e\n"]]],[],null,["# Building a Ruby application\n\nSpecifying Versions of Ruby\n---------------------------\n\nThe buildpacks project provides support for the current release and Active LTS release of Ruby. Older releases of Ruby are available but may not be actively maintained by the project.\n\n### Using `Gemfile.lock`\n\nIf your application uses bundler, you should have Gemfile.lock at the root of your repo. Ruby buildpacks will automatically use a version that's locked in your Gemfile.lock.\nFor example, if your Gemfile.lock has the following: \n\n RUBY VERSION\n ruby 3.0.3p0\n\nThe buildpacks will automatically use Ruby 3.0.3, with the latest patch level.\n\n### Using `GOOGLE_RUNTIME_VERSION`\n\nIf you're not using bundler, you can specify a ruby version using the environment variable as follows: \n\n pack build --builder=gcr.io/buildpacks/builder \\\n sample-ruby \\\n --env GOOGLE_RUNTIME_VERSION=3.0.3\n\n\nYou can also use a `project.toml` project descriptor to encode\nthe environment variable alongside your project files. See instructions on\n[building the application with environment variables](/docs/buildpacks/set-environment-variables#build_the_application_with_environment_variables)).\n\nIf you're using bundler,`GOOGLE_RUNTIME_VERSION` can't be used to override the specified version in Gemfile.lock\nunder `RUBY VERSION`.\n\nInstalling Dependencies\n-----------------------\n\n### Using Bundler\n\n- [Bundler](https://bundler.io) is the default package manager\n- Commit `Gemfile.lock` to your repo since we use the lock file to build the app\n- By default only production dependencies are installed\n\n### Bundler Version\n\nBundler has known [compatibility issues](https://bundler.io/compatibility).\nIf your application uses bundler, due to various compatibility issues with Ruby and Rubygems, we update\nthe Gemfile.lock in the built app to use one of the two supported versions.\nAll applications using bundler 1.\\* and 2.\\* in `BUNDLED WITH` are normalized to use bundler 1.17.3 and 2.3.15.\n\nSpecifying an Entrypoint\n------------------------\n\n### Using Procfile\n\nYou can specify an entrypoint, a command that runs when the container starts, using Procfile.\nFor example, with the following in your Procfile at the root of your app: \n\n web: ruby main.rb\n\nThe Ruby buildpack will use the command `ruby main.rb` as the entrypoint of the built container.\nBy default the `web` target from the Procfile is used.\n\nTo use a different entrypoint, you can specify a different target from your\nProcfile as an argument.\n\nWith a Procfile containing the following:\n`web: ruby main.rb\ncustom: ruby custom.rb`\n\nYou can use the custom Procfile target by passing it as an argument:\n`bash\npack build --builder=gcr.io/buildpacks/builder \\\nsample-ruby \\\n--entrypoint=custom`\n\n### Using `GOOGLE_ENTRYPOINT`\n\nIf you're not using a Procfile or want to override the Procfile, you can specify an entrypoint\nusing the `GOOGLE_ENTRYPOINT` environment variable. Here's an example: \n\n pack build --builder=gcr.io/buildpacks/builder \\\n sample-ruby \\\n --env GOOGLE_ENTRYPOINT=\"ruby custom.rb\"\n\nEnvironment Variables\n---------------------\n\nThe Ruby buildpack supports the following environment variables to customize your container\n\n### BUNDLE_\n\nSee `bundler` [documentation](https://bundler.io/v2.0/man/bundle-config.1.html).\n\n**Example:** `BUNDLE_TIMEOUT=60` sets `--timeout=60` for `bundle` commands."]]