在 Windows 7 上安装 Ruby on Rails - 快速简单 [英] Installing Ruby on Rails on Windows 7 - quick and easy

查看:13
本文介绍了在 Windows 7 上安装 Ruby on Rails - 快速简单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

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

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

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

使用你的控制台(在你的搜索中输入 cmd 来打开它) cd 进入你坑 RubyGems 的目录并输入:ruby setup.rb"(不带引号).p>

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).

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

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

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

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

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

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

这需要一分钟,然后如果一切顺利,您会看到很多行文本.这正在更新您的数据库,这就是 sqlite3 是什么.

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.

那么你应该有一个很好的安装并准备好骑铁轨了!

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

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

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

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

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.

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

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

注意 - 感谢 Zachary 在此网址 安装Ruby on Rails for Windows 7(最新) 帮助我入门.

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

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

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

推荐答案

InstantRails 2.0 是从 2007 年开始的,因此已经过时了.仍然有很多用户继续使用它,这仍然很奇怪.

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.

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

I would always recommend doing the following:

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

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

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 -v and gem -v should work. You might want to do a gem update --system to be safe.

同时安装 devkit!它允许您安装需要编译二进制代码的 gem(如瘦).

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

为您的乐趣安装一组通用的 windows gems.我在这篇文章中有一个批处理文件.

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

安装 git

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

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

玩得开心!:)

[2014 年 2 月更新]

[UPDATE February 2014]

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

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.

这篇关于在 Windows 7 上安装 Ruby on Rails - 快速简单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆