Dom*_*nef 395
那么,这取决于有问题的项目.某些项目的根目录中有*.gemspec文件.在那种情况下,它会
gem build GEMNAME.gemspec
gem install gemname-version.gem
Run Code Online (Sandbox Code Playgroud)
其他项目有一个rake任务,称为"gem"或"build"或类似的东西,在这种情况下你必须调用"rake",但这取决于项目.
在这两种情况下,您都必须下载源代码.
Mis*_*lin 328
如果您使用的是bundler,则需要在Gemfile中添加以下内容:
gem 'redcarpet', :git => 'git://github.com/tanoku/redcarpet.git'
Run Code Online (Sandbox Code Playgroud)
如果有.gemspec文件,它应该能够在运行时获取并安装gem bundle install.
Kam*_*mek 247
尝试使用specific_install gem,它允许您从其github存储库(如"edge")或任意URL安装gem.非常适用于在多台机器等上分配宝石和黑客攻击它们.
gem install specific_install
gem specific_install -l <url to a github gem>
Run Code Online (Sandbox Code Playgroud)
例如
gem specific_install https://github.com/githubsvnclone/rdoc.git
Run Code Online (Sandbox Code Playgroud)
Den*_*nis 32
Bundler允许您直接从git存储库使用gem.在你的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'
Run Code Online (Sandbox Code Playgroud)
有关详细信息,请参阅http://bundler.io/git.html
Mic*_*ira 16
OBSOLETE(见评论)
如果项目来自github,并且包含在http://gems.github.com/list.html上的列表中,那么您只需将github repo添加到gems源中即可安装它:
$ gem sources -a http://gems.github.com
$ sudo gem install username-projectname
Run Code Online (Sandbox Code Playgroud)
Raj*_*rma 13
如果您从公共GitHub存储库获取宝石,则可以使用该简写
gem 'nokogiri', github: 'tenderlove/nokogiri'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
200912 次 |
| 最近记录: |