15

I don't want to rely on the one-click installer any more, and I want to learn how to install Ruby manually. Is there a resource for this?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Marc Vitalis
  • 2,129
  • 4
  • 24
  • 36

6 Answers6

16
  1. Download the Windows binaries for Ruby 1.8.7 here: http://www.ruby-lang.org/en/downloads/. Extract that to wherever you would like; I use C:\ruby. Then put C:\ruby\bin in your PATH environment variable.
  2. Download the zlib package: http://www.zlib.net/zlib123-dll.zip and extract the zlib1.dll, rename it to zlib.dll and move it into your Windows\System32.
  3. Download the iconv package: http://sourceforge.net/project/showfiles.php?group_id=25167&package_id=51458. Find and extract the iconv.dll file into your Windows\System32.
  4. Download the rubygems package and follow the instructions, basically extracting the package and running ruby setup.rb.
  5. Verify that everything works properly by trying a gem install rails, once that installs then do: rails test_project
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Lolindrath
  • 2,101
  • 14
  • 20
  • 7
    I wouldn't move any DLL to the windows\System32 directory. Instead just move it to the ruby\bin directory and that will do the trick. – Dominik Grabiec Feb 14 '09 at 01:42
  • 1
    You may also need readline.dll, see http://blog.mikeadmire.com/2008/08/rubyexe-unable-to-locate-component-readlinedll/ – Bas Bossink May 23 '09 at 00:03
  • 1
    That comment from Daemin solved the problems I was having. Thanks! – jonsidnell Jun 18 '09 at 10:55
  • Here's an update for OpenSSL and ZLib (http://alwaysthecritic.typepad.com/atc/2009/03/install-ruby-191-on-windows.html). Also, make sure you have both your ruby/bin and ruby/lib directories on your path (or copy all the lib files into your bin directory). – aronchick Jan 31 '10 at 07:02
3

Well, if you're on a Mac I'd recommend MacPorts. There's a good post on it here that's still valid.

If you're on Windows and don't want to use the one-click installer you can install Cygwin and build ruby through it. Here's a post I found.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Gordon Wilson
  • 26,244
  • 11
  • 57
  • 60
2

I'd start with the one-click installer, probably by taking a good look inside the source on RubyForge (disclaimer, I haven't actually done this...). These guys clearly know how to build Ruby on Windows from source, so I'd be inclined to see how they did it.

Beyond that, did you know you can download the 1.8.7 Windows binary from the ruby-lang.org downloads page? That page also has the current stable 1.8.7 source

Mike Woodhouse
  • 51,832
  • 12
  • 88
  • 127
2

You might also need libeay32.dll and ssleay32.dll, found in OpenSSL: http://www.slproweb.com/products/Win32OpenSSL.html

Niko
  • 21
  • 2
0

If you are looking for a place to get all those DLL files - here is a trick: If you install the Ruby one-click-installer for Ruby 1.8.6, it has all of those DLL files in C:\ruby1.8.6\bin (assuming you installed it there).

I was playing with the PIK gem (rvm for Windows) and ran into that problem for Ruby 1.9.1 and after copying those DLL files everything worked perfectly.

Of course, those DLL files are somewhat old, so if Ruby 1.9.1 or 1.8.7 relies on any new features in those DLL files there might be a potential for a bug, but I haven't noticed anything so far and it beats hunting down them on the Internet.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
konung
  • 6,908
  • 6
  • 54
  • 79
0

I've pretty much concluded that Ruby 1.8.7 just isn't stable yet for Windows. I was able to get it running on one Vista machine following the instructions above but not my laptop.

For the laptop I followed the following steps and everything seems to be working so far:

  • Install 1.8.6 using the 1-click installer. Let it delete old copies of Ruby if necessary.
  • Install gems 1.3.4
  • gem install rails
  • ruby script\console
  • point browser to http://localhost:3000/. Make sure everything works as expected
  • stop console
  • extract 1.8.7 zip file into the Ruby 1.8.6 directory
  • copy dll files discussed above into the ruby/bin directory
  • restart console and again check http://localhost:3000/

I would only follow these directions as a last resort if the instructions above don't work.

Before you wag a finger at me and scold me for this approach...

please consider that I spent ~8 hours reading and trying everything possible and was able to use the approach above successfully on another computer. I'm open to other suggestions!

Kevin Dewalt
  • 757
  • 9
  • 24