Installing Ruby 1.8.7 (and other stuff) manually

前端 未结 6 1785
情书的邮戳
情书的邮戳 2021-02-01 23:12

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条回答
  • 2021-02-01 23:35

    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.

    0 讨论(0)
  • 2021-02-01 23:42
    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
    0 讨论(0)
  • 2021-02-01 23:45

    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!

    0 讨论(0)
  • 2021-02-01 23:49

    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.

    0 讨论(0)
  • 2021-02-01 23:50

    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

    0 讨论(0)
  • 2021-02-01 23:53

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

    0 讨论(0)
提交回复
热议问题