How to install gem from GitHub source?

I would like to install gem from the latest GitHub source.

How do I do this?


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'

And in case there is .gemspec file, it should be able to fetch and install the gem when running bundle install .


well, that depends on the project in question. Some projects have a *.gemspec file in their root directory. In that case, it would be

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

Other projects have a rake task, called "gem" or "build" or something like that, in this case you have to invoke "rake ", but that depends on the project.

In both cases you have to download the source.


Try the specific_install gem it allows you you to install a gem from from its github repository (like 'edge'), or from an arbitrary URL. Very usefull for forking gems and hacking on them on multiple machines and such.

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

eg

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

上一篇: 安装mysql2时出错:无法构建gem本机扩展

下一篇: 如何从GitHub源安装gem?