在不安装gem的情况下更新Gemfile.lock

时间:2021-07-28 00:22:43

Is there a way to force an update of the Gemfile.lock without installing the gems that have changed?

有没有办法强制更新Gemfile.lock而不安装已更改的gem?

4 个解决方案

#1


3  

I found an answer in a blog post by Chris Blunt: “Rails on Docker: Quickly Create or Update Your Gemfile.lock”:

我在Chris Blunt的博客文章中找到了答案:“Docker上的Rails:快速创建或更新你的Gemfile.lock”:

Today, I discovered a way to save the hours wasted downloading gems: bundler’s lock command.

今天,我发现了一种方法来节省浪费下载宝石的时间:bundler的锁定命令。

This gem of a command resolves your app’s dependencies and writes out the appropriate Gemfile.lock – without installing any of the gems themselves.

这个命令的gem可以解析你的应用程序的依赖关系并写出相应的Gemfile.lock - 而无需自己安装任何gem。

According to the changelog, this command was added in Bundler 1.10.0.pre, released about eight months after this question was asked.

根据更改日志,此命令已添加到Bundler 1.10.0.pre中,在提出此问题约八个月后发布。

#2


2  

Instead of

代替

bundle install

do the following:

请执行下列操作:

bundle lock

This will just update the Gemfile.lock, but not attempt to install the files locally. If you want to prepare a Gemfile.lock for a remote or deployment platform you must add it using

这只会更新Gemfile.lock,但不会尝试在本地安装文件。如果要为远程或部署平台准备Gemfile.lock,则必须使用它进行添加

bundle lock --add-platform ...

Latest docs at https://bundler.io/v1.16/man/bundle-lock.1.html

https://bundler.io/v1.16/man/bundle-lock.1.html上的最新文档

#3


1  

Force your specific requirement using:

使用以下方法强制执

bundle inject rmagick "=1.7.1"

#4


0  

You can build reproducible production environment using virtualization. For example Docker or VirtualBox.

您可以使用虚拟化构建可重现的生产环境。例如Docker或VirtualBox。

#1


3  

I found an answer in a blog post by Chris Blunt: “Rails on Docker: Quickly Create or Update Your Gemfile.lock”:

我在Chris Blunt的博客文章中找到了答案:“Docker上的Rails:快速创建或更新你的Gemfile.lock”:

Today, I discovered a way to save the hours wasted downloading gems: bundler’s lock command.

今天,我发现了一种方法来节省浪费下载宝石的时间:bundler的锁定命令。

This gem of a command resolves your app’s dependencies and writes out the appropriate Gemfile.lock – without installing any of the gems themselves.

这个命令的gem可以解析你的应用程序的依赖关系并写出相应的Gemfile.lock - 而无需自己安装任何gem。

According to the changelog, this command was added in Bundler 1.10.0.pre, released about eight months after this question was asked.

根据更改日志,此命令已添加到Bundler 1.10.0.pre中,在提出此问题约八个月后发布。

#2


2  

Instead of

代替

bundle install

do the following:

请执行下列操作:

bundle lock

This will just update the Gemfile.lock, but not attempt to install the files locally. If you want to prepare a Gemfile.lock for a remote or deployment platform you must add it using

这只会更新Gemfile.lock,但不会尝试在本地安装文件。如果要为远程或部署平台准备Gemfile.lock,则必须使用它进行添加

bundle lock --add-platform ...

Latest docs at https://bundler.io/v1.16/man/bundle-lock.1.html

https://bundler.io/v1.16/man/bundle-lock.1.html上的最新文档

#3


1  

Force your specific requirement using:

使用以下方法强制执

bundle inject rmagick "=1.7.1"

#4


0  

You can build reproducible production environment using virtualization. For example Docker or VirtualBox.

您可以使用虚拟化构建可重现的生产环境。例如Docker或VirtualBox。