Ruby undefined方法错误,在过程中使用Deprecate.skip_

Ruby undefined方法错误,在过程中使用Deprecate.skip_,ruby,module,gem,Ruby,Module,Gem,我正在尝试在本地计算机上安装Gitorious。但是,当我执行控制台应用程序时,会出现以下错误: /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:194:in stub\u source\u index170'中的块: 未定义的方法 Bundler::rubygemsinsintegration::Deprecate:类 (命名者) 在/usr/lib/ruby/gems/1.9.1

我正在尝试在本地计算机上安装Gitorious。但是,当我执行控制台应用程序时,会出现以下错误:

/usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:194:in stub\u source\u index170'中的
块:
未定义的方法
Bundler::rubygemsinsintegration::Deprecate:类
(命名者)

在/usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb中执行的ruby代码是:

def stub_source_index170(specs)
      Gem::SourceIndex.send(:define_method, :initialize) do |*args|
        @gems = {}
        # You're looking at this thinking: Oh! This is how I make those
        # rubygems deprecations go away!
        #
        # You'd be correct BUT using of this method in production code
        # must be approved by the rubygems team itself!
        #
        # This is your warning. If you use this and don't have approval
        # we can't protect you.
        #
        Deprecate.skip_during do
          self.spec_dirs = *args
          add_specs(*specs)
        end
      end
    end
我猜发生错误是因为未加载弃用模块或类似的东西。。。我不知道鲁比。。。但是我怎样才能纠正它呢

我有ruby 1.9.1p431(2011-02-18修订版30908)和gem 1.8.5

宝石清单:

*本地宝石*

actionmailer(2.3.5)actionpack (2.3.5)activerecord(2.3.8、2.3.5) activeresource(2.3.5)activesupport (2.3.8、2.3.5)作为标签 (2.0.6)制造商(3.0.0)捆扎机 (1.0.15)慢性(0.3.0) 守护进程控制器(0.2.6)守护进程 (1.1.0)差异lcs(1.1.2)回波(4.3.1) eventmachine(0.12.10) 例外情况通知(1.0.20090728) 工厂女孩(1.3.3)快速螺纹 (1.0.7)GEMCUTER(0.6.1)geoip (0.8.9)hoe(2.8.0)json_pure(1.5.0) mime类型(1.16)摩卡(0.9.10)mysql (2.8.1)oauth(0.4.4)回形针 (2.2.9.2)乘客(3.0.7) proxymachine(1.2.4)机架(1.0.1) 轨道(2.3.5)耙(0.8.7)耙 (1.3.1.1)revo-ssl_要求(1.1.0) riddle(1.2.2)rmagick(2.13.1) ruby hmac(0.4.0)ruby openid(2.1.8) ruby yadis(0.3.4)rubyforge(2.0.4) shoulda(2.9.2)状态机(0.9.4) stomp(1.1)stompserver(0.9.9)tuxml (0.0.1)验证 (0.1.1)将(2.3.15)

非常感谢


Carlos.

Rubygems的新版本正在弃用一些旧的内部方法。您可以使用
gem update--system 1.x.y
(例如1.5.2)降级Rubygems,以查看这是否解决了您的问题。

Deprecate的名称空间为gem::Deprecate。您可以临时修补它:

Gem::Deprecate.skip_during do
  self.spec_dirs = *args
  add_specs(*specs)
end

嗨,谢谢你的回答。我是Ruby新手。系统降级是否会影响已安装的gems?谢谢?不,这不会影响已安装的gems。