简体   繁体   English

我正在使用 RVM,使用 bundle install 和 rvm bundle install 有什么区别?

[英]I'm using RVM, what is the difference between using bundle install and rvm bundle install?

I would like to know the difference?我想知道有什么区别?

I can run both and they install but what is the actual difference?我可以同时运行它们并安装它们,但实际区别是什么?

I'm doing a tutorial/screencast by michael hart and he uses bundle install, how does this differ from using rvm bundle install?我正在做 michael hart 的教程/截屏视频,他使用 bundle install,这与使用 rvm bundle install 有何不同?

I also decided to try out a trial of the "rubymine" ide and I noticed after running bundle install in terminal then opening the ide it tells me I need to update some gems so I'm sure it doesn't install bundles in the same place.我还决定尝试试用“rubymine”ide,我注意到在终端中运行 bundle install 然后打开 ide 它告诉我需要更新一些 gem,所以我确定它不会在同一个中安装包地方。

I've loaded up an rvm project in it.我已经在其中加载了一个 rvm 项目。

I think from this question, that you've not quite grasped the difference between rvm and bundler and what exactly each does.我认为从这个问题中,您还没有完全掌握rvmbundler之间的区别以及它们各自的作用。 I'll try and explain the difference.我将尝试解释其中的区别。

RVM is an acronym for Ruby enVironment (Version) Manager. RVM是 Ruby 环境(版本)管理器的首字母缩写。 It's a set of command-line scripts to help "sandbox" ruby binaries and gems for a project or set of projects.它是一组命令行脚本,可帮助一个或一组项目的“沙盒”ruby 二进制文件和 gem。 This way if you have one project that requires Ruby 1.8 and another that uses Ruby 1.9, you can switch easily between the two ruby installations and avoid nasty incompatibilities or cumbersome configuration.这样,如果您有一个需要 Ruby 1.8 的项目和另一个使用 Ruby 1.9 的项目,您可以在两个 ruby 安装之间轻松切换,避免麻烦的不兼容。

You can also install different gemsets with each ruby version, so if you need to develop some applications with Ruby on Rails 2.3 and some with 3.0, or if you want to try the new 3.1 prelease, you can do so without breaking other applications' dependencies.您还可以为每个 ruby 版本安装不同的 gemset,因此如果您需要在 Rails 2.3 上开发一些使用 Ruby 的应用程序和一些使用 3.0 的应用程序,或者如果您想尝试新的 3.1 版本,您可以这样做而不会破坏其他应用程序的依赖关系.

Bundler is a ruby gem which, as the website says, manages an application's dependencies through its entire life across many machines systematically and repeatably. Bundler是一个 ruby gem,正如网站所说,它在整个生命周期中系统地和可重复地管理应用程序在许多机器上的依赖关系。

Bundler makes it easy to copy one application's source from one machine to another and install all the gems and dependencies needed by that particular application quickly and (relatively) painlessly. Bundler 可以轻松地将一个应用程序的源代码从一台机器复制到另一台机器,并快速且(相对)轻松地安装该特定应用程序所需的所有 gem 和依赖项。

So I understand the confusion as there is a bit of overlap.所以我理解混乱,因为有一点重叠。 RVM gemsets are similar to gem bundles. RVM gemset 类似于 gem 包。 The difference is that bundler manages the gems and dependencies for a single application and across multiple machines .不同之处在于,bundler 管理单个应用程序多台机器的 gems 和依赖项。 An rvm gemset is a sandbox that keeps a group of gems in one place, tied to a particular ruby installation on a single machine, sometimes used for multiple applications. rvm gemset 是一个沙箱,将一组 gem 保存在一个地方,与单个机器上的特定 ruby 安装相关联,有时用于多个应用程序。

So to close, when you say you "loaded up an rvm project" in your IDE, that's not particularly true.所以最后,当你说你在 IDE 中“加载了一个 rvm 项目”时,这并不是特别正确。 RVM is a sandbox, not a framework. RVM 是一个沙箱,而不是一个框架。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM