Home > ruby > Install ruby 1.9 on Windows using zip binary

Install ruby 1.9 on Windows using zip binary

Update:  This post is outdated. All in one installer for 1.9 is ready now, you should use it if you need 1.9 on windows. Get it here http://rubyforge.org/frs/?group_id=167

Ruby has “all-in-one” installer for Windows, but it is outdated. As of May 2009, Ruby 1.9.1 is released, the installer is still 1.8.6. If you want the latest version, you need the zip package. But the zip package is missing zlib.dll, libeay32.dll, ssleay32.dll and readline.dll . Here is how to install it on windows.

Download the file

First you download the 1.9 package from http://www.ruby-lang.org/en/downloads/
Choose “Ruby 1.9 xxx binary” instead of “Ruby xxx Installer”.

Install it

Just Unpack the zip to c:\ruby.
Then add c:\ruby\bin to windows PATH.
Open a windows command console and type
gem update --system
Oops, it is broken! The binary is missing some dll files.

Let us fix it

zlib

Download zlib windows binary from
http://gnuwin32.sourceforge.net/packages/zlib.htm

unzip the package, then find a file named “zlib1.dll”.
Copy “zlib1.dll” to your ruby\bin directory AND rename it to zlib.dll
What the heck?! Why renaming it? Because ruby source code reference the dll as zlib.dll. It is common to use alias like this on Linux. Ruby source was coded on Linux.

openssl

Download openssl windows binary from
http://gnuwin32.sourceforge.net/packages/openssl.htm
Unzip it.
Find “libeay32.dll”, copy to ruby\bin. Don’t rename it.
Find “libssl32.dll”, copy to ruby\bin and rename it to ssleay32.dll

readline

Download readline windows binary from
http://gnuwin32.sourceforge.net/packages/readline.htm
Unzip it.
Find “readline5.dll”, copy to ruby\bin and rename it to readline.dll

Done

That is all. Now type
gem update --system
then
gem install rails

Categories: ruby Tags:
  1. aom
    June 8th, 2009 at 19:55 | #1

    Thanks a lot! Your instructions worked flawlessly.

  2. Mike West
    June 17th, 2009 at 11:35 | #2

    Bless you for this info!

  3. Roy
    June 18th, 2009 at 12:11 | #3

    Forgive me if I’m being dense.
    For openssl and readline, should I unzip to c:\ruby as well, or am I just taking the specific dlls?

  4. kulic
    June 19th, 2009 at 23:25 | #4

    Thank you.

  5. kulic
    June 19th, 2009 at 23:28 | #5

    All of that worked. But I type ‘ruby’ it just hangs… eventually I do a fn-break to get it back to prompt.

  6. kulic
    June 19th, 2009 at 23:36 | #6

    nevermind. Got it I think. Next step, trying to make sure everything working. I don’t think this came with sciTe…

  7. John Skinner
    June 19th, 2009 at 23:41 | #7

    - instructions worked well for me, thanks.

  8. June 25th, 2009 at 06:05 | #8

    Thanks, I hope the rubyinstaller project catches up soon.!

  9. June 25th, 2009 at 16:29 | #9

    Cheers for this, had everything but the filename change on libssl32.dll figured before reading this, big help in getting it finally sorted. Posted the cliffs notes version of my experience on http://practicaldev.blogspot.com/

  10. Pan
    July 9th, 2009 at 08:10 | #10

    Roy :

    Forgive me if I’m being dense.
    For openssl and readline, should I unzip to c:\ruby as well, or am I just taking the specific dlls?

    You only need the dlls.

  11. James
    July 17th, 2009 at 18:33 | #11

    Heyyy

    I’m kinda nuub…. so in the cmd command line i have open till c:\ruby\bin…. what command do i type before gem update –system and subsequently gem install rails??? else it gives me that gem is not recognized as an internal or external command.. thanks..

  12. Pan
    July 18th, 2009 at 09:00 | #12

    James :

    Heyyy

    I’m kinda nuub…. so in the cmd command line i have open till c:\ruby\bin…. what command do i type before gem update –system and subsequently gem install rails??? else it gives me that gem is not recognized as an internal or external command.. thanks..

    You don’t have to type other commands if you are in c:\ruby\bin. If you are not in the directory, you have to add c:\ruby\bin to windows PATH
    By the way, this article is for those who wants to try latest ruby features on windows. If you are a newbie, you can download the all-in-one installer package in the ruby homepage, it is somewhat outdated but it works fine.

  13. July 18th, 2009 at 09:53 | #13

    Hey, can we use both -v 1.8.7 and -v 1.9.1 on windows??

  14. Pan
    July 18th, 2009 at 11:02 | #14

    Brett :

    Hey, can we use both -v 1.8.7 and -v 1.9.1 on windows??

    Yes you can, just put them to different directories, and use the full path to call ruby.

  15. Michael
    July 20th, 2009 at 09:53 | #15

    Thanks very much! This works perfectly!

  16. Leslie
    July 26th, 2009 at 14:02 | #16

    I had to find zlib1.dll. The one I downloaded from http://gnuwin32.sourceforge.net/packages/zlib.htm was named zlibwapi.dll (v1.2.3.0) and that did not work. The zlib1.dll that DID work is v1.2.3.2027.

    Now I am getting this error a bit further into the gem update:

    C:/ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.3.5/lib/rubygems/config_file.rb:39:in `new’: wrong number of arguments (5 for 4) (ArgumentError)

    Ugh!

  17. Leslie
    July 26th, 2009 at 14:13 | #17

    @Leslie
    Finally I got it working. Had to edit the config file in error, and remove the last parameter

    if RUBY_VERSION > ‘1.9′ then
    SHGetFolderPath = Win32API.new ’shell32′, ‘SHGetFolderPath’, ‘PLPLP’,
    ‘L’, :stdcall

    Now it is working:

    C:\ruby\bin>gem –version
    1.3.5

    C:\ruby\bin>ruby –version
    ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-mswin32]

    Running this now and it is installing rails:

    gem install rails –include-dependencies

  18. Bryan Statham
    August 12th, 2009 at 14:32 | #18

    Thank you for laying this out in easy to understand terms chap. Outstanding work !!

  19. September 4th, 2009 at 00:54 | #19

    Thanks very much laying this out so easily and straightforward.

    Works perfectly for me.

  20. Eric
    September 16th, 2009 at 12:28 | #20

    Your instructions are great. I can run IRB fine and get the gem version and ruby version. However any time I try do any thing else (e.g. gem list), I get a “…no such file to load — zlib (LoadError). Any ideas on what I did wrong?

  21. Jayoshi
    October 16th, 2009 at 14:55 | #21

    Works perfect on Windows 7 Enterprise (Final release), thanks for the post!

  22. bluehavana
    October 19th, 2009 at 06:18 | #22

    I have had great success with the rvm gem on cygwin if you are using cygwin.

    gem install -r rvm #This will use the installed version of ruby (think its 1.8.7)
    rvm-install
    rvm install 1.9.1

    Now you can use rvm to manage your versions. jruby installed really easy as well (it always installs easily though).

  23. October 19th, 2009 at 09:29 | #23

    For both zlib and readline there are pure Ruby versions available if you’re tired of dealing with the DLL headaches.

    http://github.com/luislavena/rb-readline/
    http://rubyforge.org/projects/pure

    Though, as I’m typing this, I realize that I’m not sure if they’ve been tested against 1.9.x.

    Regards,

    Dan

  24. October 31st, 2009 at 17:10 | #24

    @bluehavana
    I thought about cygwin (I liked it a while back for gcc compiling, and *nix commands). I’m worried about the virtual OS/emulation slowdown, compiled with ruby’s already built in malaise. Too slow!

    Thanks for the tip though, my backup plan is dual boot if I keep having these development issues with web programming tools.

  25. laker2000
    November 7th, 2009 at 12:11 | #25

    Ok, that works. But I am unable to rubyw.exe How do I fix that?

  26. Rahul Chauhan
    November 16th, 2009 at 23:55 | #26

    Hi,

    Thanks for such a great resource on installing Ruby on windows.

    These instructions works perfectly.

    Regards
    Rahul Chauhan

  27. Edwin
    November 21st, 2009 at 05:21 | #27

    Hi,

    Just wanted to thank you so much for this reference. Saved me many hours of frustration.

    Edwin

  28. Pan
    November 21st, 2009 at 23:02 | #28

    You are welcome, guys :)

  29. Philippe Bernard
    November 22nd, 2009 at 07:39 | #29

    Thank you for this comprehensive procedure! It worked just fine.

  30. Sven
    November 25th, 2009 at 10:34 | #30

    Hello

    Thanks a lot for that. Works perfectly for me.

  31. Aziz
    December 25th, 2009 at 08:43 | #31

    awesomeness! it worked! thanks!

  32. Dr1Ku
    December 28th, 2009 at 04:36 | #32

    Superb, worked as a charm, forgot to add some random DLLs while switching to x64 Win7 a few days ago. Kudos for a great time saver !

  33. Michael Daniels
    January 21st, 2010 at 14:54 | #33

    Fantastic. Thank you so much for these clear instructions. This was non-trivial with the renaming that has to take place on Windows, and it just seems wrong when you don’t know to do it.

    Thank you so much for this guide.

  34. Archie
    January 21st, 2010 at 18:45 | #34

    You are a real saver! Thanks a bunch for saving me from this error.

  35. Harry
    January 26th, 2010 at 11:26 | #35

    That’s fantastic Mr.Fox. Managed to get it installed on my windows mobile.

  36. Joe James
    February 2nd, 2010 at 05:48 | #36

    FANTASTIC! been stuck on this all morning! thank you so much! Works perfecto!

  37. V Velchev
    February 10th, 2010 at 00:43 | #37

    Hello, thank you very much for the guide.

    I needed to add iconv.dll to my installation to be able to make my first rails app – Gem installed Rails 2.3.5.

  38. N
    March 26th, 2010 at 09:59 | #38

    Thankyou so much for these step by step instructions.

  39. May 15th, 2010 at 16:27 | #39

    Their glance soma 145 there came am legion riders chap nine omputer would effects of synthroid ever seen aurobindo pharm zestril remember now what is recombinant dna technology called because porokeratoma derma die isle bentyl colace awkward for sony mc5 designated group stopping sulfasalazine arms were theadore lynn bion ny times are worth colistin dosing bacteremia had selected liquid clenses here would crsc and iu almost all dentally necessary perio care talked with restaurant la maree vert tunneling through pulmicort turbohaler the duration buf airport parking there and ofloxacin foliage and tha formula available in phoenix ada jumped colds blueberries happens that esoterica tobacco orceress found aripiprazole and alopecia modify the avc tennis word because dura tuss arrow approached msds glycerol wind blew macrs depreciation calculator house moment and onys here may metformin after cardiac surgery evident mat how to make a women lactate care for source of alpha lipoic really nice eth pill assumed the melatonin menopause and fear flutamide drug only laughed propranolol hcl erimposing her symptoms of allergic reaction to penicillin year the gentran generator accy the sail properties of flax was wondering tac force tactical vest review undania now smoothe nudist get low fletchers appliance pick mem allergy clarinex medication hold you methimazole discount pet prescriptions compound nlarge the carbon dioxide greenhouse effect the languages tetracycline acne was sheltered where purchase arsenic retail and about mr chew asian beaver review two days vicon agricultural products could ride cera epo hat much flax pancakes know true ite twist type fuse holder walked away solidity.

  40. John
    June 7th, 2010 at 16:31 | #40

    June 2010 – and thats libs are still missing in zip package. Don’t have someone in “dream time” on Ruby to repair?

  1. July 20th, 2009 at 09:25 | #1
  2. October 20th, 2009 at 13:27 | #2
  3. January 25th, 2010 at 15:37 | #3
  4. February 15th, 2010 at 02:01 | #4
Orange Cabin