本文介绍了在系统范围内安装 RVM 是一个坏主意吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困惑,在服务器上,您是应该以普通用户身份安装 RVM 还是进行系统范围的安装,如果是后者,您应该如何执行 捆绑安装而不使用sudo.

I'm confused about whether, on a server, you're supposed to install RVM as a regular user or do a system-wide installation, and, if the latter, how you're supposed to do things like bundle install without using sudo.

就 RVM 而言,在运行 Rails 的服务器上,是否有任何关于您应该做什么的明确指导方针,例如乘客和 Nginx?在这种类型的环境中,并非所有 Ruby 进程都在同一用户下运行,因此我认为就 RVM 和捆绑程序而言,这就是事情变得不清楚的地方.

Is there any definite set of guidelines on what you're supposed to do as far as RVM is concerned on a server running Rails under e.g. Passenger and Nginx? In this type of environment, not all Ruby processes run under the same user, so I think that's where things get unclear as far as RVM and bundler are concerned.

如何避免在服务器上一起使用 RVM 并在那里以老式方式安装 Ruby 和 gems?如果你能侥幸逃脱,那是不是更可取?

How about just avoiding RVM all together on the server and just installing Ruby and gems the old fashioned way there? Is that preferable if you can get away with it?

推荐答案

您可以以普通用户的身份安装 RVM,尽管我不明白这一点.Bundler 是针对每个应用程序的,不需要 sudo 权限,因为它可以将您的 gem 安装到捆绑安装用户可以访问的捆绑目录中,例如:

You could install RVM as a regular user, although I don't see the point. Bundler is per-application and doesn't need sudo privileges since it can install your gems into a bundle directory that the bundle install user can access with, for instance:

bundle install --deployment

默认情况下会将它们放在 vendor/bundle 中.

which will put them in vendor/bundle by default.

我将 RVM 视为管理多个 ruby​​ 版本的开发工具.在部署机器上,我倾向于使用系统 Ruby 或从源代码安装.

I think of RVM as a development tool for managing multiple ruby versions. On deployment machines I tend to either use system Ruby or install from source.

这篇关于在系统范围内安装 RVM 是一个坏主意吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 12:36