在 Elastic Beanstalk 上使用 Gemfile 安装程序包 - AWS Elastic Beanstalk

在 Elastic Beanstalk 上使用 Gemfile 安装程序包

要使用 RubyGems 安装您的应用程序所需的程序包,请在您的项目源的根目录中包含一个 Gemfile 文件。

例 Gemfile
source "https://rubygems.org" gem 'sinatra' gem 'json' gem 'rack-parser'

如果 Gemfile 文件存在,Elastic Beanstalk 将运行 bundle install 以安装依赖项。有关更多信息,请参阅 Bundler.io 网站上的 GemfilesBundle(捆绑包)页面。

注意

除了 Ruby 平台预装的默认版本外,还可以使用其他版本的 Puma。为此,请在 Gemfile 中包含指定版本的条目。您还可以使用自定义的 Gemfile 来指定不同的应用程序服务器,例如 Passenger。

对于这两种情况,您都需要配置 Procfile 以启动应用程序服务器。

有关更多信息,请参阅使用 Procfile 配置应用程序进程