如何从GitHub源安装gem?

我想从最新的GitHub源代码安装gem。

我该怎么做呢?


如果你使用的是捆绑器,你需要在你的Gemfile中添加这样的内容:

gem 'redcarpet', :git => 'git://github.com/tanoku/redcarpet.git'

如果有.gemspec文件,它应该能够在运行bundle install时获取并安装gem。


那么,这取决于有问题的项目。 有些项目的根目录中有一个* .gemspec文件。 在那种情况下,它会是

gem build GEMNAME.gemspec
gem install gemname-version.gem

其他项目有一个rake任务,称为“宝石”或“构建”或类似的东西,在这种情况下,你必须调用“rake”,但这取决于项目。

在这两种情况下,你都必须下载源代码。


试试specific_install gem它允许你从它的github仓库(比如'edge')或者任意的URL安装一个gem。 非常有用的分叉宝石和在多台机器上黑客攻击等。

gem install specific_install
gem specific_install -l <url to a github gem>

例如

gem specific_install https://github.com/githubsvnclone/rdoc.git 
链接地址: http://www.djcxy.com/p/35923.html

上一篇: How to install gem from GitHub source?

下一篇: Am I missing something by not installing ri and rdoc for gems?