简体   繁体   English

使用Bundler从Github安装gem

[英]Installing a gem from Github with Bundler

I am trying to use the instructions here to install a pre-released version of a gem with bundler. 我正在尝试使用这里说明来安装带有bundler的预发布版本的gem。

The "bundle install" output lists the gem as getting installed, but "gem list" fails to find it. “bundle install”输出将gem列为已安装,但“gem list”无法找到它。

My Gemfile: 我的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). 注意:我也在使用RVM(在OS X上)。 bundle show does list the gem (and dependencies) as existing, but I am not able to properly resolve them. bundle show会将gem(和依赖项)列为现有的,但我无法正确解析它们。

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. Bundler为您配置加载路径,这意味着默认情况下并非所有gem都包含在加载路径中。

Additionally, from the bundler git help : 另外,从bundler git帮助

Because Rubygems lacks the ability to handle gems from git, any gems installed from a git repository will not show up in gem list . 由于Rubygems缺乏从git处理gems的能力,因此从git存储库安装的任何gem都不会显示在gem列表中 They will, however, be available after running Bundler.setup. 但是,它们将在运行Bundler.setup可用。

Best regards, hope this helps 最好的问候,希望这有帮助

ED ED

Bundler might have installed it locally to your app. Bundler可能已将其本地安装到您的应用程序。 This could vary wildly, depending on OS and whether you are using RVM. 这可能会有很大差异,具体取决于操作系统以及您是否使用RVM。

What is the output of bundle show sinatra ? bundle show sinatra的输出是什么?

In my case, sinatra was installed here: 就我而言,sinatra安装在这里:

/home/marshall/.rvm/gems/ruby-1.8.7-p302@3846859/bundler/gems/sinatra-9cfa74a7f352

Sinatra doesn't show in the gems list, but the server launches correctly if I execute rackup . Sinatra没有显示在gems列表中,但是如果我执行rackup ,服务器会正​​确启动。

It looks like there is an issue using Shotgun and Bundler (git repositories only). 看起来使用Shotgun和Bundler存在问题(仅限git存储库)。

If I use rackup to start up my app, all is well. 如果我使用rackup来启动我的应用程序,一切都很好。 I am going to investigate a little more and then file a bug with one (or both) of the projects. 我将进行更多调查,然后向一个(或两个)项目提交错误。

Gems installed via bundler on Engine Yard go to a different folder to isolate them. 通过Engine Yard上的bundler安装的Gems转到另一个文件夹以隔离它们。

it's usually /data/APP_NAME/shared/bundled_gems 它通常是/data/APP_NAME/shared/bundled_gems

To be sure, check your .bundle/config file on your APP folder at Engine Yard 当然,请检查Engine Yard上APP文件夹中的.bundle/config文件

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

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