使用 Bundler 从 Github 安装 gem [英] Installing a gem from Github with Bundler
问题描述
我正在尝试使用 此处的说明来安装带有捆绑程序的 gem 的预发布版本.
bundle install"输出将 gem 列为正在安装,但gem list"找不到它.
我的宝石文件:
来源:gemcutter宝石'sinatra','1.1.0',:git =>'http://github.com/sinatra/sinatra.git'宝石'红布','4.2.3'
这是一个 gist 以及我的示例代码的其余部分.
有没有人让这个场景工作?
注意:我也在使用 RVM(在 OS X 上).bundle show 确实将 gem(和依赖项)列为现有,但我无法正确解决它们.
谢谢.
我会查看加载路径,并从那里进一步调试,例如:
...(master) $ irbirb(主):001:0>$LOAD_PATH.count=>8irb(主):004:0>需要捆绑器/设置"=>真的irb(主):005:0>$LOAD_PATH.count=>112irb(主):006:0>
Bundler 为您配置加载路径,这意味着默认情况下并非所有 gem 都包含在您的加载路径中.
另外,来自 bundler git help:
<块引用><块引用>因为 Rubygems 缺乏处理来自 git 的 gem 的能力,所以从 git 存储库安装的任何 gem 都不会显示在 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
这篇关于使用 Bundler 从 Github 安装 gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!