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

我怎么做呢?


当前回答

你也可以执行gem install username-projectname -s http://gems.github.com

其他回答

在一台新的Linux机器上,您还需要安装git。Bundle在幕后使用它。

如果你正在使用捆绑器,你需要在你的Gemfile中添加这样的东西:

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

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

乌利希期刊指南。正如评论中所指出的,为了让Bundler正常工作,你还需要在config.ru中添加以下内容:

require "bundler" 
Bundler.setup(:default)

你也可以使用rdp/specific_install gem:

gem install specific_install
gem specific_install https://github.com/capistrano/drupal-deploy.git

Bundler允许你直接从git存储库中使用gems。 在您的Gemfile中:

# Use the http(s), ssh, or git protocol
gem 'foo', git: 'https://github.com/dideler/foo.git'
gem 'foo', git: 'git@github.com:dideler/foo.git'
gem 'foo', git: 'git://github.com/dideler/foo.git'

# Specify a tag, ref, or branch to use
gem 'foo', git: 'git@github.com:dideler/foo.git', tag: 'v2.1.0'
gem 'foo', git: 'git@github.com:dideler/foo.git', ref: '4aded'
gem 'foo', git: 'git@github.com:dideler/foo.git', branch: 'development'

# Shorthand for public repos on GitHub (supports all the :git options)
gem 'foo', github: 'dideler/foo'

欲了解更多信息,请访问https://bundler.io/v2.0/guides/git.html

如果你从一个公共的GitHub存储库中获取你的gems,你可以使用这个简写

gem 'nokogiri', github: 'tenderlove/nokogiri'