197

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?

jwfearn
  • 28,781
  • 28
  • 95
  • 122
fbonetti
  • 6,652
  • 3
  • 34
  • 32

5 Answers5

207

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.

februaryInk
  • 705
  • 1
  • 8
  • 15
Franco Rondini
  • 10,841
  • 8
  • 51
  • 77
  • @webRat Just re-edit the post; I agree with you, the rbrealine.rb was introduced by a wrong (I suppose) Edit by community. Thanks for your attention! – Franco Rondini Jul 30 '13 at 07:37
  • 1
    All this sounds so unsatisfactory. Anyway, taking note of the comment below from Msangle, "What is fiddle?" – will Dec 14 '13 at 12:30
  • Using `Ruby 2.0.x`, I had an error message in addition to warning, `DL is deprecated, please use Fiddle.` I installed `Ruby 1.9` and no longer have this error. Thanks to this site - https://www.openshift.com/kb/kb-e1080-why-all-rhc-commands-on-windows-result-in-dl-is-deprecated-please-use-fiddle-error. – Kevin Meredith Apr 21 '14 at 21:14
  • DL, Fiddle... what are these things at all? – Paul Jun 14 '14 at 05:56
  • 1
    @Paul, at the last two lines of the answer there are two link that maybe you have not seen: http://ruby-doc.org/stdlib-2.0.0/libdoc/fiddle/rdoc/Fiddle.html , http://www.ruby-doc.org/stdlib-2.0.0/libdoc/dl/rdoc/DL.html – Franco Rondini Jun 14 '14 at 08:31
  • 2
    On my Windows machine, I located this files `rbreadline.rb` and `readline.rb` at `C:\RailsInstaller\Ruby2.1.0\lib\ruby\site_ruby\2.1.0\ `. I changed the line from `require 'dl'` to `require 'fiddle'`. No more warnings. – Blairg23 Jun 19 '15 at 08:53
  • 1
    This doesn't work as there are dependencies down the line, I'm afraid, @Blairg23 – Martin Greenaway Aug 14 '15 at 10:00
  • C:\RailsInstaller\Ruby2.1.0\lib\ruby\2.1.0 line 8 – Sunil B N Dec 25 '15 at 08:55
73

You may want to comment out the DL is deprecated, please use Fiddle warning at

C:\Ruby200\lib\ruby\2.0.0\dl.rb

since it’s annoying and you are not the irb/pry or some other gems code owner

Zombo
  • 1
  • 62
  • 391
  • 407
Erwin Kaddy
  • 967
  • 7
  • 14
  • 3
    If you are getting this error when running `vagrant up` on Windows, this file can be found at `C:\vagrant\embedded\lib\ruby\2.0.0dl.rb`. – sjy Feb 18 '14 at 06:09
  • 1
    Thanks @syj, mine was located at `C:\HashiCorp\Vagrant\embedded\lib\ruby\2.0.0\dl.rb` – mpen Feb 19 '14 at 02:11
  • C:\RailsInstaller\Ruby2.1.0\lib\ruby\2.1.0\dl.rb line 8 – Sunil B N Dec 25 '15 at 08:54
3

I got this resolution at openshift.com.

Resolution:

This error occurs only on Windows machine with Ruby 2.0.0 version. Until we officially support Ruby 2.0 please downgrade to Ruby 1.9.

On Windows, you can install Ruby 1.9.3 alongside 2.0. Change your %PATH% to c:\ruby193\ or whatever directory you installed to prior to installing the gem.

Rod Argumedo
  • 610
  • 11
  • 29
Gaurav
  • 39
  • 1
3

The message "DL is deprecated, please use Fiddle" is not an error; it's only a warning.
Solution:
You can ignore this in 3 simple steps.
Step 1. Goto C:\RailsInstaller\Ruby2.1.0\lib\ruby\2.1.0
Step 2. Then find dl.rb and open the file with any online editors like Aptana,sublime text etc
Step 3. Comment the line 8 with '#' ie # warn "DL is deprecated, please use Fiddle" .
That's it, Thank you.

2

I ran into this myself when I wanted to make a thor command under Windows.

To avoid having that message output everytime I ran my thor application I temporarily muted warnings while loading thor:

begin
  original_verbose = $VERBOSE
  $VERBOSE = nil
  require "thor"
ensure
  $VERBOSE = original_verbose
end

That saved me from having to edit third party source files.

thomthom
  • 2,854
  • 1
  • 23
  • 53