如何修复"bundler:找不到命令:rails"使用Google Cloud App Engine进行部署时 [英] How to fix "bundler: command not found: rails" when deploying using Google Cloud App Engine

查看:183
本文介绍了如何修复"bundler:找不到命令:rails"使用Google Cloud App Engine进行部署时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用App Engine Flexible Environment将Rails应用程序部署到Google Cloud.当我运行gcloud app deploy时,一切正常,但最后,当App Engine尝试使用bundle exec rails server -p $PORT(如我的app.yaml文件中指定的)运行我的应用程序时,它崩溃并给出以下错误消息:

I am trying to deploy my Rails app to Google Cloud using App Engine Flexible Environment. Everything works fine when I run gcloud app deploy, but at the very end, when App Engine tries to run my application using bundle exec rails server -p $PORT, as specified in my app.yaml file, it crashes and gives the following error message:

错误响应:[9]应用程序启动错误:'bundler:命令未执行 找到:用bundle install

Error Response: [9] Application startup error: 'bundler: command not found: rails Install missing gem executables with bundle install

我尝试更改entrypoint的值,一次又一次地运行bundle install,并在本地安装我所有的gem文件,但是这些都不起作用.我还尝试安装机架并更改端点以使用rackup命令运行该应用程序,但这也不起作用.由于先前的错误是

I tried changing the entrypoint value, running bundle install again and again, and installing all my gem files locally, but none of that worked. I also tried installing rack and changing the endpoint to run the app using rackup command, but that didn't work either. I am also skipping my gemfile.lock in my app.yaml file due to a previous error that was solved on SO.

推荐答案

我收到此错误的原因是,由于之前认为我已解决的错误Gemfile.lock进行一些编辑以解决该问题,而不是避免它.可以在此处查看.

The reason I was getting this error is because I was skipping the Gemfile.lock due to a previous error that I thought was solved here. The aforementioned 'solution' led to this error. The solution that I found is to make some edits to Gemfile.lock that solved the issue instead of avoiding it. The edits can be seen here.

这篇关于如何修复"bundler:找不到命令:rails"使用Google Cloud App Engine进行部署时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆