如何安装本地 gem? [英] How can I install a local gem?
问题描述
如果我将 .gem 文件下载到我计算机的某个文件夹中,我可以稍后使用 gem install
安装它吗?
If I download a .gem file to a folder in my computer, can I install it later using gem install
?
推荐答案
是的,当你做 gem install
时,它会先搜索当前目录,所以如果你的 .gem 文件在那里,它会捡起来.我在 gem 参考 上找到了它,您可能会发现它也很方便:
Yup, when you do gem install
, it will search the current directory first, so if your .gem file is there, it will pick it up. I found it on the gem reference, which you may find handy as well:
gem install 将安装命名的宝石.它将尝试本地安装(即 .gem 文件中的当前目录),如果失败,它将尝试下载和安装最新版本的你想要的宝石.
gem install will install the named gem. It will attempt a local installation (i.e. a .gem file in the current directory), and if that fails, it will attempt to download and install the most recent version of the gem you want.
这篇关于如何安装本地 gem?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!