如何获得特定的“提交"来自github的宝石? [英] How to get a specific "commit" of a gem from github?

查看:22
本文介绍了如何获得特定的“提交"来自github的宝石?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 rails_admin,并且由于它处于(非常)活跃的开发阶段,因此出现了错误时不时地.

据我所知,对于 github 中的 gem,gem 没有版本,所以我不能使用 :version 键作为 Gemfile 中的 gem 声明.

有没有办法可以将特定的提交(我知道对我来说工作正常)绑定"到 Gemfile 上?

我目前在我的 Gemfile 中有:

gem 'rails_admin',:git =>'git://github.com/sferik/rails_admin.git'

我希望能够做这样的事情(例如commit_id"):

gem 'rails_admin',:git =>'git://github.com/sferik/rails_admin.git',:commit_id =>4e7d53e3c5c4c3c5c43c3"

这可以用github做吗?

解决方案

以下任何一种都应该有效:

gem 'rails', :git =>'git://github.com/rails/rails.git', :ref =>'4ad'gem 'rails', :git =>'git://github.com/rails/rails.git', :branch =>'2-3-稳定'gem 'rails', :git =>'git://github.com/rails/rails.git', :tag =>'v2.3.5'

来源:如何从 git 安装 gems存储库

I'm using rails_admin, and since it is in (very) active development, bugs turn up every now and then.

There are no versions for the gem as far as I can tell, for the gem in github, so I can't use the :version key for the gem declaration in the Gemfile .

Is there a way I can "tie" a specific commit(that I know is working fine for me) to the Gemfile ?

I currently have in my Gemfile:

gem 'rails_admin', 
  :git => 'git://github.com/sferik/rails_admin.git'

I'd like to be able to do something like this (example "commit_id"):

gem 'rails_admin', 
  :git => 'git://github.com/sferik/rails_admin.git',
  :commit_id => "4e7d53e3c5c4c3c5c43c3"

Is this possible to do with github?

解决方案

Any of these should work:

gem 'rails', :git => 'git://github.com/rails/rails.git', :ref => '4aded'

gem 'rails', :git => 'git://github.com/rails/rails.git', :branch => '2-3-stable'

gem 'rails', :git => 'git://github.com/rails/rails.git', :tag => 'v2.3.5'

Source: How to install gems from git repositories

这篇关于如何获得特定的“提交"来自github的宝石?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆