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?
6 Answers
- 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 putC:\ruby\bin
in your PATH environment variable. - 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.
- 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.
- Download the rubygems package and follow the instructions, basically extracting the package and running ruby
setup.rb
. - Verify that everything works properly by trying a
gem install rails
, once that installs then do:rails test_project
-
7I 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. Feb 14, 2009 at 1:42
-
1You may also need readline.dll, see blog.mikeadmire.com/2008/08/… May 23, 2009 at 0:03
-
1That comment from Daemin solved the problems I was having. Thanks! Jun 18, 2009 at 10:55
-
Here's an update for OpenSSL and ZLib (alwaysthecritic.typepad.com/atc/2009/03/…). 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). Jan 31, 2010 at 7:02
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.
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
You might also need libeay32.dll and ssleay32.dll, found in OpenSSL: http://www.slproweb.com/products/Win32OpenSSL.html
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!
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.