Ruby 2.0.0p0 IRB 警告:“不推荐使用 DL,请使用 Fiddle" [英] Ruby 2.0.0p0 IRB warning: "DL is deprecated, please use Fiddle"

查看:25
本文介绍了Ruby 2.0.0p0 IRB 警告:“不推荐使用 DL,请使用 Fiddle"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚卸载了旧版本的 Ruby,删除了所有 gem(包括 Rails),并安装了 Ruby 2.0.换句话说,完全干净的重新安装.启动 IRB 后,我收到此消息:

<前>DL 已弃用,请使用 Fiddle

注意:我使用的是 Windows 机器.

这条消息是什么意思?

解决方案

当你有 ruby 2.0.0p0 (2013-02-24) 时,你收到的消息很常见> 在 Windows 之上.

消息DL is deprecated, please use Fiddle"不是错误;这只是一个警告.

来源是DL的弃用通知介绍了一些前一段时间在 dl.rb (见 revisions/37910 ).

在 Windows 上,lib/ruby/site_ruby/2.0.0/readline.rb 文件仍然需要 dl.rb 所以警告信息当您 需要 'irb' (因为 irb 需要 'readline' )或其他任何需要 需要 'readline' 时出现.>

您可以使用您喜欢的文本编辑器打开 readline.rb 并查找代码(靠近第 4369 行):

 如果 RUBY_VERSION <'1.9.1'需要'Win32API'别的需要'dl'Win32API 类DLL = {}

我们总是希望能够在 Ruby 的未来版本中改进以解决此弃用问题.

对于那些想要更深入地了解 FiddleDL 的人,可以说他们的目的是将外部库与 Ruby 动态链接;你可以在 ruby​​-doc 网站上阅读关于 DLFiddle.>

I just uninstalled my older versions of Ruby, removed all of my gems (including Rails), and installed Ruby 2.0. In other words, a totally clean re-install. Upon starting IRB, I received this message:

DL is deprecated, please use Fiddle

Note: I'm on a Windows machine.

What does this message mean?

解决方案

The message you received is common when you have ruby 2.0.0p0 (2013-02-24) on top of Windows.

The message "DL is deprecated, please use Fiddle" is not an error; it's only a warning.

The source is the Deprecation notice for DL introduced some time ago in dl.rb ( see revisions/37910 ).

On Windows the lib/ruby/site_ruby/2.0.0/readline.rb file still requires dl.rb so the warning message comes out when you require 'irb' ( because irb requires 'readline' ) or when anything else wants to require 'readline'.

You can open readline.rb with your favorite text editor and look up the code ( near line 4369 ):

    if RUBY_VERSION < '1.9.1'
      require 'Win32API'
    else
      require 'dl'
      class Win32API
        DLL = {}

We can always hope for an improvement to work out this deprecation in future releases of Ruby.

EDIT: For those wanting to go deeper about Fiddle vs DL, let it be said that their purpose is to dynamically link external libraries with Ruby; you can read on the ruby-doc website about DL or Fiddle.

这篇关于Ruby 2.0.0p0 IRB 警告:“不推荐使用 DL,请使用 Fiddle"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆