简体   繁体   English

如何从Github直接使用边缘版本的Sunspot,而不是通过Rubygems?

[英]How do I use the edge version of Sunspot direct from Github instead of via Rubygems?

In order to overcome a bug with solr, I need to run a newer version than the one included in the Rubygems version of Sunspot. 为了克服solr的错误,我需要运行一个比Rubysms版本的Sunspot中包含的版本更新的版本。 I noticed on Github that there has been a very recent commit which includes a newer version of Solr. 我注意到在Github上有一个最近的提交 ,其中包括更新版本的Solr。

How do I configure my Gemfile to pull straight from the repo instead of from RubyGems. 如何配置我的Gemfile直接从repo而不是RubyGems。 Currently I have the following; 目前我有以下几点;

gem 'sunspot'
gem 'sunspot_rails'
gem 'sunspot_test'
gem 'sunspot_cell', :git => 'git://github.com/zheileman/sunspot_cell.git'

group :development, :test do
  gem 'sunspot_solr'
  gem 'progress_bar'
end

If I simply add the repo to the sunspot gem line, everything falls apart when I run bundle. 如果我只是将回购添加到太阳黑子宝石线,当我运行捆绑时,一切都会崩溃。 As the sunspot_solr gem is within the sunspot repo , I don't know the line I should use to grab that from the repo. 由于sunspot_solr gem 在太阳黑子回购中 ,我不知道我应该使用哪条线从回购中获取。

Thanks, Graeme 谢谢,格雷姆

Got it! 得到它了! The answer is to point to the main repo on github and use require where appropriate to narrow it down to the relevant sub-section. 答案是指向github上的主要回购,并在适当的地方使用require将其缩小到相关的子部分。

The edited Gemfile is as follows; 编辑过的Gemfile如下;

gem 'sunspot', :git => "git://github.com/sunspot/sunspot.git"
gem 'sunspot_rails', :git => "git://github.com/sunspot/sunspot.git", :require =>  "sunspot_rails"
gem 'sunspot_test'
gem 'sunspot_cell', :git => 'git://github.com/zheileman/sunspot_cell.git'

group :development, :test do
  gem 'sunspot_solr', :git => "git://github.com/sunspot/sunspot.git", :require => "sunspot_solr"
  gem 'progress_bar'
end

我不是一个红宝石开发人员,但这里是一个关于从Git安装Gems的演练,可能会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM