在 Windows 7 上安装 Ruby on Rails - 快速简单

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3541038/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 15:05:16  来源:igfitidea点击:

Installing Ruby on Rails on Windows 7 - quick and easy

ruby-on-railswindowswindows-7installationinstall

提问by Ken

Since I had so many issues installing RoR on my laptop with Windows 7, I thought I would share my steps with you. Many people tell you to use InstantRails. I did that one too, but the option below worked best for me.

由于我在装有 Windows 7 的笔记本电脑上安装 RoR 时遇到很多问题,我想我会与您分享我的步骤。许多人告诉您使用 InstantRails。我也这样做了,但下面的选项最适合我。

  1. Download and install Ruby 1.8.7http://rubyforge.org/frs/download.php/71492/rubyinstaller-1.8.7-p299.exe

  2. Download the latest RubyGems, and extract the file somewhere http://rubyforge.org/frs/?group_id=126

  3. Using your console (type cmd in your search to open it) cd into the directory you pit RubyGems and type: "ruby setup.rb" (without the quotes).

  1. 下载并安装 Ruby 1.8.7 http://rubyforge.org/frs/download.php/71492/rubyinstaller-1.8.7-p299.exe

  2. 下载最新的 RubyGems,并将文件解压到http://rubyforge.org/frs/?group_id=126

  3. 使用您的控制台(在您的搜索中输入 cmd 以打开它) cd 进入您存放RubyGems 的目录并输入:“ ruby setup.rb”(不带引号)。

It will take a minute and then if all went well, you will see lots of lines of text.

这将需要一分钟,然后如果一切顺利,您将看到很多文本行。

  1. Then in your console type: "gem install rails" (without the quotes)
  1. 然后在您的控制台中输入:“ gem install rails”(不带引号)

It will take a minute and then if all went well, you will see lots of lines of text.

这将需要一分钟,然后如果一切顺利,您将看到很多文本行。

  1. Then in your console type: "gem install sqlite3-ruby" (without the quotes)
  1. 然后在您的控制台中输入:“ gem install sqlite3-ruby”(不带引号)

It will take a minute and then if all went well, you will see lots of lines of text. This is updating your database, which is what sqlite3 is.

这将需要一分钟,然后如果一切顺利,您将看到很多文本行。这是更新您的数据库,这就是 sqlite3。

Then you should have a nice install and be ready to ride the rails!

那么你应该有一个很好的安装并准备好乘坐导轨!

There are many tutorials out there but I bought this book: Agile Web Development with Rails (3) -

那里有很多教程,但我买了这本书:Agile Web Development with Rails (3) -

I first bought Simply Rails 2 and even chatted with the author a little. Simply Rails 2 was a good fit if I stayed with InstantRails. He really explains everything well if you are a designer (like me) and are taking longer to grasp the coding side of programming.

我先买了Simply Rails 2,还和作者聊了几句。如果我继续使用 InstantRails,Simply Rails 2 非常适合。如果你是一名设计师(像我一样)并且需要更长时间来掌握编程的编码方面,他真的很好地解释了一切。

Are there any steps after this that you would like to share? Is this helpful?

在此之后,您有什么步骤要分享吗?这有帮助吗?

Note - Thanks to Zachary at this url Installing Ruby on Rails for Windows 7 (up to date)for helping me get started.

注意 - 感谢 Zachary 在这个 url上为 Windows 7 安装 Ruby on Rails(最新)帮助我开始。

Editor worth mentioning (but not free) - RubyMine http://www.jetbrains.com/ruby/

值得一提的编辑器(但不是免费的) - RubyMine http://www.jetbrains.com/ruby/

回答by nathanvda

InstantRails 2.0 is from 2007 and is thus sorely outdated. It still is weird how there remain a lot of users that keep starting with that.

InstantRails 2.0 来自 2007 年,因此非常过时。仍然有很多用户继续使用它仍然很奇怪。

I would always recommend doing the following:

我始终建议您执行以下操作:

  • use the latest version from Rubyinstaller.org(now they are 1.8.7p302)

  • there is no need to install the rubygems package seperately, it is included in the rubyinstaller (so also in the one you used). You can just run the executable and the commands ruby -vand gem -vshould work. You might want to do a gem update --systemto be safe.

  • also install the devkit! it allows you to install gems that need to compile binary code (like thin).

  • install a common set of windows gems for your pleasure. I have a batch-file written up in this post.

  • install git

  • install an editor of your choice (Netbeans which is free, or use Rubymine which is awesome!)

  • 使用Rubyinstaller.org的最新版本(现在是 1.8.7p302)

  • 不需要单独安装 ruby​​gems 包,它包含在 ruby​​installer 中(所以也包含在您使用的那个中)。您可以只运行可执行文件和命令,ruby -v并且gem -v应该可以工作。gem update --system为了安全起见,您可能想要做一个。

  • 还要安装devkit!它允许您安装需要编译二进制代码的 gem(如瘦)。

  • 为您的乐趣安装一组通用的 Windows gem。我在这篇文章中写了一个批处理文件。

  • 安装 git

  • 安装您选择的编辑器(免费的 Netbeans,或使用很棒的 Rubymine!)

Have fun! :)

玩得开心!:)

[UPDATE February 2014]

[2014 年 2 月更新]

I helped at a RailsGirls meet, and there we got the girls started up in no time using the RailsInstaller(and it is available for Windows and Mac OSX). While I personally prefer to do it manually, this is a great alternative to get you started.

我在 RailsGirls 会议上提供帮助,在那里我们让女孩们立即开始使用RailsInstaller(它适用于 Windows 和 Mac OSX)。虽然我个人更喜欢手动完成,但这是让您入门的绝佳选择。

回答by Rekin

Installing gitand TortoiseGIT.

安装gitTortoiseGIT