为什么在将rails应用程序推送到heroku之前需要“捆绑安装”?

时间:2021-08-22 00:19:43

I suppose the bundling is going to happen on the heroku servers anyway. What is the purpose of doing it on the local machine?

我想无论如何捆绑都会发生在heroku服务器上。在本地机器上执行此操作的目的是什么?

4 个解决方案

#1


1  

bundle install

This ensures that all gems specified in Gemfile, together with their dependencies, are available for your application. Running bundle install also generates a Gemfile.lock file, which should be added to your git repository. Gemfile.lock ensures that your deployed versions of gems on Heroku match the version installed locally on your development machine.

这可确保Gemfile中指定的所有gem及其依赖项都可用于您的应用程序。运行bundle install还会生成一个Gemfile.lock文件,该文件应该添加到你的git存储库中。 Gemfile.lock确保您在Heroku上部署的gems版本与开发计算机上本地安装的版本匹配。

If the platforms section of your Gemfile contains Windows entries, such as mswin or mingw, then the Gemfile.lock file will be ignored.

如果Gemfile的platforms部分包含Windows条目,例如mswin或mingw,则将忽略Gemfile.lock文件。

Heroku also uses that file to resolve and install your application dependencies automatically. All you need to do is to push it.

Heroku还使用该文件自动解析和安装应用程序依赖项。你需要做的就是推动它。

Refer this link : Click Here

请参阅此链接:单击此处

#2


1  

This will update your Gemfile.lock, that heroku uses to install all your gems on your virtual server. The Gemfile.lock contains all information about your gems and their respective versions.

这将更新您的Gemfile.lock,heroku用于在您的虚拟服务器上安装所有宝石。 Gemfile.lock包含有关您的宝石及其各自版本的所有信息。

#3


1  

It has two purposes :

它有两个目的:

  1. It ensures you that, on your machine, you have all the dependencies for your application satisfied;
  2. 它可以确保您在计算机上满足应用程序的所有依赖关系;

  3. It updates the Gemfile.lock file. While the Gemfile has the list of your app's gems, the Gemfile.lock has a more.. "detailed" version of it, with the gem's own dependencies, their version constraints... It basically is a snapshot of your project dependencies. This way, your app in production will run with the exact same versions of third-party code as do your code in local.
  4. 它更新Gemfile.lock文件。虽然Gemfile有应用程序宝石的列表,但Gemfile.lock有一个更详细的版本,有宝石自己的依赖项,它们的版本限制......它基本上是项目依赖项的快照。这样,生产中的应用程序将使用与本地代码完全相同的第三方代码版本运行。

#4


0  

This ensures that all gems specified in Gemfile, together with their dependencies, are available for your application. Running bundle install also generates a Gemfile.lock file, which should be added to your git repository. Gemfile.lock ensures that your deployed versions of gems on Heroku match the version installed locally on your development machine.

这可确保Gemfile中指定的所有gem及其依赖项都可用于您的应用程序。运行bundle install还会生成一个Gemfile.lock文件,该文件应该添加到你的git存储库中。 Gemfile.lock确保您在Heroku上部署的gems版本与开发计算机上本地安装的版本匹配。

Source: https://devcenter.heroku.com/articles/bundler

#1


1  

bundle install

This ensures that all gems specified in Gemfile, together with their dependencies, are available for your application. Running bundle install also generates a Gemfile.lock file, which should be added to your git repository. Gemfile.lock ensures that your deployed versions of gems on Heroku match the version installed locally on your development machine.

这可确保Gemfile中指定的所有gem及其依赖项都可用于您的应用程序。运行bundle install还会生成一个Gemfile.lock文件,该文件应该添加到你的git存储库中。 Gemfile.lock确保您在Heroku上部署的gems版本与开发计算机上本地安装的版本匹配。

If the platforms section of your Gemfile contains Windows entries, such as mswin or mingw, then the Gemfile.lock file will be ignored.

如果Gemfile的platforms部分包含Windows条目,例如mswin或mingw,则将忽略Gemfile.lock文件。

Heroku also uses that file to resolve and install your application dependencies automatically. All you need to do is to push it.

Heroku还使用该文件自动解析和安装应用程序依赖项。你需要做的就是推动它。

Refer this link : Click Here

请参阅此链接:单击此处

#2


1  

This will update your Gemfile.lock, that heroku uses to install all your gems on your virtual server. The Gemfile.lock contains all information about your gems and their respective versions.

这将更新您的Gemfile.lock,heroku用于在您的虚拟服务器上安装所有宝石。 Gemfile.lock包含有关您的宝石及其各自版本的所有信息。

#3


1  

It has two purposes :

它有两个目的:

  1. It ensures you that, on your machine, you have all the dependencies for your application satisfied;
  2. 它可以确保您在计算机上满足应用程序的所有依赖关系;

  3. It updates the Gemfile.lock file. While the Gemfile has the list of your app's gems, the Gemfile.lock has a more.. "detailed" version of it, with the gem's own dependencies, their version constraints... It basically is a snapshot of your project dependencies. This way, your app in production will run with the exact same versions of third-party code as do your code in local.
  4. 它更新Gemfile.lock文件。虽然Gemfile有应用程序宝石的列表,但Gemfile.lock有一个更详细的版本,有宝石自己的依赖项,它们的版本限制......它基本上是项目依赖项的快照。这样,生产中的应用程序将使用与本地代码完全相同的第三方代码版本运行。

#4


0  

This ensures that all gems specified in Gemfile, together with their dependencies, are available for your application. Running bundle install also generates a Gemfile.lock file, which should be added to your git repository. Gemfile.lock ensures that your deployed versions of gems on Heroku match the version installed locally on your development machine.

这可确保Gemfile中指定的所有gem及其依赖项都可用于您的应用程序。运行bundle install还会生成一个Gemfile.lock文件,该文件应该添加到你的git存储库中。 Gemfile.lock确保您在Heroku上部署的gems版本与开发计算机上本地安装的版本匹配。

Source: https://devcenter.heroku.com/articles/bundler