views:

7066

answers:

8

Hi,

I don't want to rely on one-click installer anymore and I want to learn how to install ruby manually. Do you have any resource for this?

Thanks a lot.

Cheers

+3  A: 

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.

Gordon Wilson
A: 

Sorry, I'm using windows. T_T

Marc Vitalis
Then use cigwin or mingw to manually compile Ruby.
Keltia
+1  A: 

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
+12  A: 
  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 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
Lolindrath
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.
Daemin
You may also need readline.dll, see http://blog.mikeadmire.com/2008/08/rubyexe-unable-to-locate-component-readlinedll/
Bas Bossink
That comment from Daemin solved the problems I was having. Thanks!
jsidnell
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
+2  A: 

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

Niko
A: 

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
What errors are you getting in your event log?
Marc Vitalis
A: 

I copied the missing dlls from the older ruby 1.8.6 bin directory to 1.9.1 bin directory. Then after there were no such error massages.

A: 

If you are looking for a place to get all those *.dll - here is a trick - if you install ruby one-click-installer for ruby 1.8.6 - it has all of those dlls in c:\ruby1.8.6\bin (assuming you installed it there). I was playing with PIK gem (rvm for windows) and ran into that problem for ruby 1.9.1 and after copying those dlls everything worked perfectly. Of course, those dlls are somewhat old, so if ruby1.9.1 or 1.8.7 relies on any new features in those dlls there might be a potential for a bug, but I haven't noticed anything so far and it beats hunting down them on internet.

Nick Gorbikoff