部署到Azure时Rails应用程序崩溃

时间:2020-09-10 20:14:17

标签: ruby-on-rails ruby azure azure-web-app-service

我正在尝试将Rails应用程序部署为Azure上的WebApp。我尝试遵循此guide。部署正常。但是,当我尝试在浏览器中访问该页面时,它就会崩溃。

2020-09-10T20:08:46.739615274Z running bundle install  --local --path vendor/bundle
2020-09-10T20:08:47.601183687Z Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
2020-09-10T20:08:47.602571397Z installing your bundle as root will break this application for all non-root
2020-09-10T20:08:47.602587497Z users on this machine.
2020-09-10T20:08:48.118327788Z Warning: the running version of Bundler (1.17.2) is older than the version that created the lockfile (1.17.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
2020-09-10T20:08:48.360206948Z The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
2020-09-10T20:08:48.509477972Z Could not find rake-12.3.3 in any of the sources
2020-09-10T20:08:48.517855329Z defaulting to command: "bundle exec rails server -e production -p 8080"
2020-09-10T20:08:49.353444362Z bundler: command not found: rails
2020-09-10T20:08:49.354345768Z Install missing gem executables with `bundle install`
2020-09-10T20:08:50.336Z ERROR - Container myapp_0_4ec4bebe for site myapp has exited, failing site start
2020-09-10T20:08:50.353Z ERROR - Container myapp_0_4ec4bebe didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
2020-09-10T20:08:50.382Z INFO  - Stopping site myapp because it failed during startup.

1 个答案:

答案 0 :(得分:0)

必须使用所有必需的gems部署Ruby应用程序。您可能会参考此official document,其中描述了Azure App Service如何在Linux容器中运行Ruby应用程序,以及如何在需要时自定义App Service的行为。

您可以对此tutorial for Build a Ruby and Postgres app in Azure App Service on Linux

进行调查