windows 手动安装 Ruby 1.8.7(和其他东西)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/390897/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Installing Ruby 1.8.7 (and other stuff) manually
提问by Marc Vitalis
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?
我不想再依赖一键安装程序了,我想学习如何手动安装 Ruby。有这方面的资源吗?
回答by Lolindrath
- 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.zipand 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
- 在此处下载适用于 Ruby 1.8.7 的 Windows 二进制文件:http://www.ruby-lang.org/en/downloads/ 。将其提取到您想要的任何位置;我用
C:\ruby
. 然后放入C:\ruby\bin
你的 PATH 环境变量。 - 下载 zlib 包:http: //www.zlib.net/zlib123-dll.zip 并解压缩 zlib1.dll,将其重命名为 zlib.dll 并将其移动到您的 Windows\System32。
- 下载 iconv 包:http: //sourceforge.net/project/showfiles.php? group_id=25167&package_id=51458 。查找 iconv.dll 文件并将其解压缩到您的 Windows\System32 中。
- 下载 rubygems 包并按照说明进行操作,基本上解压缩包并运行 ruby
setup.rb
。 - 通过尝试 a 来验证一切正常
gem install rails
,一旦安装,然后执行:rails test_project
回答by Gordon Wilson
Well, if you're on a Mac I'd recommend MacPorts. There's a good post on it herethat's still valid.
好吧,如果您使用的是 Mac,我会推荐MacPorts。有它好的帖子这里这仍然有效。
If you're on Windows and don't want to use the one-click installeryou can install Cygwinand build ruby through it. Here's a postI found.
如果您使用的是 Windows 并且不想使用一键安装程序,您可以安装Cygwin并通过它构建 ruby。这是我找到的一个帖子。
回答by Mike Woodhouse
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.
我会从一键安装程序开始,可能是通过仔细查看RubyForge 上的源代码(免责声明,我实际上还没有这样做......)。这些家伙清楚地知道如何从源代码构建 Windows 上的 Ruby,所以我倾向于看看他们是如何做到的。
Beyond that, did you know you can download the 1.8.7 Windows binaryfrom the ruby-lang.org downloads page? That page also has the current stable 1.8.7 source
除此之外,您是否知道可以从ruby-lang.org 下载页面下载1.8.7 Windows 二进制文件?该页面还有当前稳定的1.8.7 源
回答by Niko
You might also need libeay32.dll and ssleay32.dll, found in OpenSSL: http://www.slproweb.com/products/Win32OpenSSL.html
您可能还需要在 OpenSSL 中找到的 libeay32.dll 和 ssleay32.dll:http://www.slproweb.com/products/Win32OpenSSL.html
回答by Kevin Dewalt
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.
我几乎得出结论,Ruby 1.8.7 对于 Windows 来说还不稳定。我能够按照上述说明在一台 Vista 机器上运行它,但不能在我的笔记本电脑上运行。
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/
- 使用一键安装程序安装 1.8.6。如有必要,让它删除旧的 Ruby 副本。
- 安装宝石 1.3.4
- 宝石安装导轨
- 红宝石脚本\控制台
- 将浏览器指向http://localhost:3000/。确保一切按预期进行
- 停止控制台
- 将 1.8.7 zip 文件解压到 Ruby 1.8.6 目录中
- 将上面讨论的 dll 文件复制到 ruby/bin 目录中
- 重新启动控制台并再次检查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!
请考虑到我花了大约 8 个小时阅读并尝试了所有可能的方法,并且能够在另一台计算机上成功使用上述方法。我愿意接受其他建议!
回答by konung
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).
如果您正在寻找一个地方来获取所有这些 DLL 文件 - 这里有一个技巧:如果您为 Ruby 1.8.6 安装了 Ruby 一键安装程序,它会包含所有这些 DLL 文件C:\ruby1.8.6\bin
(假设您安装在那里) .
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.
我正在玩 PIK gem(适用于 Windows 的 rvm)并遇到了 Ruby 1.9.1 的问题,在复制这些 DLL 文件后,一切正常。
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.
当然,这些 DLL 文件有些陈旧,因此如果 Ruby 1.9.1 或 1.8.7 依赖于这些 DLL 文件中的任何新功能,则可能存在错误,但到目前为止我还没有注意到任何事情,而且效果很好在互联网上追捕他们。