How can I install a local gem?

如果我将.gem文件下载到我的计算机中的文件夹中,以后可以使用gem install来安装它吗?


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 will install the named gem. It will attempt a local installation (ie 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.


Also, you can use gem install --local path_to_gem/filename.gem

This will skip the usual gem repository scan that happens when you leave off --local .

You can find other magic with gem install --help .


you can also use the full filename to your gem file:

gem install /full/path/to/your.gem

this works as well -- it's probably the easiest way

链接地址: http://www.djcxy.com/p/35918.html

上一篇: 找不到Gem Server和Rails RDoc

下一篇: 我如何安装本地宝石?