无限加载宝石(需要子标题)

时间:2014-10-28 23:18:08

标签: ruby gem rubygems bundler

我很抱歉这个标题,因为我真的不确定如何描述它。基本上,我有一组我建造的宝石,通常命名为“mygems-gem1”,“mygems-gem2”等。

我决定如果我制作另一个宝石“mygems”会更容易,这需要所有的儿童宝石(即“mygems-gem1”等)。

我试过这个,构建并安装了gem,并加载了IRB。但是,现在要求“mygems”永远存在,永远不会加载任何东西。看起来像依赖冲突,可能吗?

真正奇怪的是,我可以加载IRB并手动使用儿童宝石并且效果很好。

是什么给出了?

编辑:让它继续运行,它永远不会引发错误。我不知道这是否有任何帮助,但是在CTRL + Cing出来之后,我得到了这个堆栈跟踪:

from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/basic_specification.rb:62:in `call' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/basic_specification.rb:62:in `block (2 levels) in contains_requirable_file?' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/basic_specification.rb:62:in `each' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/basic_specification.rb:62:in `any?' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/basic_specification.rb:62:in `block in contains_requirable_file?' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/basic_specification.rb:60:in `each' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/basic_specification.rb:60:in `any?' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/basic_specification.rb:60:in `contains_requirable_file?' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/specification.rb:951:in `block (2 levels) in find_in_unresolved_tree' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/specification.rb:2397:in `[]' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/specification.rb:2397:in `block (2 levels) in traverse' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/specification.rb:2396:in `each' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/specification.rb:2396:in `block in traverse' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/specification.rb:2395:in `each' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/specification.rb:2395:in `traverse' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/specification.rb:2398:in `block (2 levels) in traverse' ... 17 levels... from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:93:in `require' from /home/kinginky/.rvm/gems/ruby-2.1.2/gems/method_source-0.8.2/lib/method_source.rb:7:in `<top (required)>' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require' from /home/kinginky/.rvm/gems/ruby-2.1.2/gems/pry-0.10.1/lib/pry.rb:124:in `<top (required)>' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `require' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `require' from /home/kinginky/.rvm/gems/ruby-2.1.2/gems/mygems-gem1-0.12.8/lib/mygems/gem1.rb:2:in `<top (required)>' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `require' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `require' from /home/kinginky/.rvm/gems/ruby-2.1.2/gems/mygems-0.0.1/lib/mygems.rb:3:in `<top (required)>' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require' from /home/kinginky/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require' from (irb):1 from /home/kinginky/.rvm/rubies/ruby-2.1.2/bin/irb:11:in `<main>'

1 个答案:

答案 0 :(得分:0)

  

我试过这个,构建并安装了gem,并加载了IRB。

你不需要为此建造宝石。如果你只用

创建一个ruby脚本怎么办?
require "mygems-gem1"
require "mygems-gem2"
...

require那个?这有用吗?