我正在try 使用以下说明部署一个玩具rails 7应用程序: https://cloud.google.com/ruby/rails/appengine;但是,该过程在步骤2失败.如果我理解下面的消息,我需要添加命令

bundle lock --add-platform x86_64-linux

到安装过程中.但是,我不知道在哪里指定安装过程(例如,要运行哪些Bundle 包命令).指令只是简单地说创建app.yaml,然后运行gcloud app deploy.

Step #2: [DEPRECATED] The `--deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local deployment 'true'`, and stop using this flag
Step #2: [DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local without 'development test'`, and stop using this flag
Step #2: Your bundle only supports platforms ["x86_64-darwin-23"] but your local platform
Step #2: is x86_64-linux. Add the current platform to the lockfile with
Step #2: `bundle lock --add-platform x86_64-linux` and try again.
Step #2: The command '/bin/sh -c bundle install --deployment --without="development test" && rbenv rehash' returned a non-zero code: 16
Finished Step #2
ERROR
ERROR: build step 2 "gcr.io/cloud-builders/docker@sha256:b30a2bedbbd24823a41fe768379ab8dd362cd71c0eb6cfd6de58b225805e4c13" failed: step exited with non-zero status: 16
Step #2: 

推荐答案

将其作为社区维基发布,以便其他人可以从中受益.


正如@dbugger所说:

如果你在安装过程中不运行它,你可以在部署之前运行bundle lock --add-platform x86\_64-linux来更新你的锁文件

Ruby-on-rails相关问答推荐

DELETE_IF和REJECT的意外行为!方法

无法安装Ruby错误运行';__rvm_make-J4';,

这种使用on:的语法在 Ruby on Rails 中意味着什么?

正确更新其他列的更新列

如何在 Ruby 字符串中返回最后一个斜杠(/)之后的所有内容

Gem 更新:在从 ASCII-8BIT 到 UTF-8 到 US-ASCII 的转换中,无法将 "\xE7" 转换为 UTF-8

Rails 4,使用 ActiveRecord 的原始查询

具有条件的列的计数器缓存?

Rails:使用 RSpec 测试命名范围

如何在rails中发回js.haml

在 rake 任务期间关闭观察者的简单方法?

Rails:使用 gem 卸载特定版本的库

遇到在早期版本的 Rails 中使用 attr_accessible 的情况时,Rails 4 中的禁止属性错误

如何让 ActiveAdmin 使用强参数?

在 Rails 中复制模型实例

控制器 helper_method

Ruby on Rails - link_to 按钮 / css

如何在 Ruby on Rails 的内存缓存存储中列出键?

rake db:回滚不起作用?

如何检测rails是否在根url?