如何从 GitHub 源安装 gem? [英] How to install gem from GitHub source?
本文介绍了如何从 GitHub 源安装 gem?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从最新的 GitHub 源安装 gem.
I would like to install gem from the latest GitHub source.
我该怎么做?
推荐答案
如果你正在使用 bundler,你需要在你的 Gemfile 中添加这样的东西:
In case you are using bundler, you need to add something like this to your Gemfile:
gem 'redcarpet', :git => 'git://github.com/tanoku/redcarpet.git'
如果有 .gemspec
文件,它应该能够在运行 bundle install
时获取并安装 gem.
And in case there is .gemspec
file, it should be able to fetch and install the gem when running bundle install
.
UPD. 如注释中所述,要使 Bundler 正常运行,您还需要将以下内容添加到 config.ru
:
UPD. As indicated in comments, for Bundler to function properly you also need to add the following to config.ru
:
require "bundler"
Bundler.setup(:default)
这篇关于如何从 GitHub 源安装 gem?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文