从Github和Bundler安装一个gem [英] Installing a gem from Github with Bundler
问题描述
我正尝试使用此处的说明,以使用捆绑器安装gem的预发布版本。
bundle install输出将gem列为安装,但gem list无法找到它。
我的Gemfile:
来源:gemcutter
gem'sinatra','1.1.0',:git => 'http://github.com/sinatra/sinatra.git'
gem'RedCloth','4.2.3'
以下是我的示例代码的要点。
有没有人得到这个场景的工作?
注意:我也使用RVM(在OS X上)。 bundle show确实将gem(和依赖关系)列为现有的,但我无法正确解决它们。
谢谢。
我会查看加载路径,并从那里进一步调试,例如:
...(master)$ irb
irb(main):001:0> $ LOAD_PATH.count
=> 8
irb(main):004:0>要求'bundler / setup'
=> true
irb(main):005:0> $ LOAD_PATH.count
=> 112
irb(main):006:0>
Bundler会为您配置负载路径,这意味着并非所有宝石都包含在您的负载路径中默认值。
另外,从 bundler git help :
由于Rubygems缺乏从git处理gem的能力,因此从git存储库安装的任何gem都不会显示在宝石列表。但是,它们将在运行 Bundler.setup后可用。 >最好的问候,希望这有助于
ED
I am trying to use the instructions here to install a pre-released version of a gem with bundler.
The "bundle install" output lists the gem as getting installed, but "gem list" fails to find it.
My Gemfile:
source :gemcutter gem 'sinatra', '1.1.0', :git => 'http://github.com/sinatra/sinatra.git' gem 'RedCloth', '4.2.3'
Here is a gist with the rest of my sample code.
Has anyone gotten this scenario to work?
NOTE: I am also using RVM (on OS X). bundle show does list the gem (and dependencies) as existing, but I am not able to properly resolve them.
Thanks.
解决方案I would look at the load paths, and further debug from there, example:
...(master) $ irb irb(main):001:0> $LOAD_PATH.count => 8 irb(main):004:0> require 'bundler/setup' => true irb(main):005:0> $LOAD_PATH.count => 112 irb(main):006:0>
Bundler configures the load path for you, this means not all the gems are included on your load path by default.
Additionally, from the bundler git help:
Because Rubygems lacks the ability to handle gems from git, any gems installed from a git repository will not show up in gem list. They will, however, be available after running Bundler.setup.
Best regards, hope this helps
ED
这篇关于从Github和Bundler安装一个gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!