简体   繁体   English

Ubuntu上的rvm安装,用于管理不同的Rails应用程序

[英]rvm installation on Ubuntu for managing different rails applications

I need to install rvm on a new Ubuntu machine. 我需要在新的Ubuntu计算机上安装rvm
I would use rvm to switch to different ruby versions and gemsets required by different Ruby on Rails applications. 我将使用rvm切换到不同的Ruby on Rails应用程序所需的不同的ruby版本和宝石集。

rvm suggests to use the Ubuntu package . rvm 建议使用Ubuntu软件包 However Internet documentation on Rails on Ubuntu, such as at RailsApp , suggests to install rvm using instead the curl command with the --ruby or --rails options and the --autolibs=enable option for avoiding missing libraries: 但是,Ubuntu上的Rails上的Internet文档(例如RailsApp )建议使用带有--ruby--rails选项和--autolibs=enable选项的curl命令来安装rvm,以避免丢失库:

$ \curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enable

I could not find information specific to the --rails option, so I do not understand what it does, install only the rails gem or install rails plus other gems useful for the rails environment, like bundler and json for instance. 我找不到特定于--rails选项的信息,因此我不明白它的作用,仅安装rails gem或安装rails以及其他对rails环境有用的gems,例如bundlerjson There is a bug however: RVM does not install Rails when invoked with curl . 但是,存在一个错误: 用curl调用RVM时不会安装Rails

Considering that I do not need the rails gem in the global gemset, supposing that the above bug will soon be fixed, what is in the end the best choice for installing rvm in Ubuntu: the Ubuntu package or the curl command with the (hopefully explained) --rails option plus the --autolibs=enable option? 考虑到我不需要全局gemset中的rails gem,并假设上述错误将很快得到解决,最终在Ubuntu中安装rvm的最佳选择是什么:Ubuntu软件包或带有curl的curl命令(希望说明)-- --rails选项加​​上--autolibs=enable选项?

It depends on your Ubuntu Version. 这取决于您的Ubuntu版本。

lsb_release -a

Then you can search for the instructions based on your Ubuntu Release. 然后,您可以根据您的Ubuntu版本搜索说明。 For example I am using Linux Mint based on Ubuntu Xenial 16 . 例如,我正在使用基于Ubuntu Xenial 16 Linux Mint Ubuntu uses the apt package manager to install packages Ubuntu使用apt软件包管理器安装软件包

To find packages type in your terminal 要查找软件包,请在终端中输入

apt search rvm

it will return a list of packages. 它将返回软件包列表。 To learn more about apt use: 要了解有关apt使用的更多信息:

apt --help
apt <command> --help
man apt

To install RVM you need to always reference their official webpage or github page 要安装RVM,您需要始终参考其官方网页github页面

For ubuntu RVM has an official Ubuntu Page which give you the following instructions: 对于ubuntu RVM,有一个官方的Ubuntu页面 ,为您提供以下说明:

https://github.com/rvm/ubuntu_rvm https://github.com/rvm/ubuntu_rvm

Follow those instructions 遵循这些指示

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

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