简体   繁体   English

在Windows 7中安装Ruby on Rails

[英]Installing Ruby on Rails in windows 7

I saw some ruby tutorials today and like to learn it. 我今天看到了一些红宝石教程,并喜欢学习它。 The problem is that i'm stuck with the installation process! 问题是我坚持安装过程! :( :(

I can't get a clear picture on how to install RoR. 我无法清楚地了解如何安装RoR。 For example, to write php code i installed wamp and straight away started writing php scripts. 例如,编写我安装了wamp的php代码并立即开始编写php脚本。 And i'm using Dreamweaver CS4 as an IDE. 我正在使用Dreamweaver CS4作为IDE。

Can anyone enlighten me : 任何人都可以启发我:

1) the process of installing RoR? 1)安装RoR的过程?

2) an IDE for RoR 2)用于RoR的IDE

3) What are gems? 3)什么是宝石? are they modules? 他们是模块吗?

thanks :) 谢谢 :)

UPDATE: (2011-11-05) 更新:(2011-11-05)

RubyInstaller is now mature and IS the preferred way to do the install: http://rubyinstaller.org/ RubyInstaller现在已经成熟并且是安装的首选方式: http ://rubyinstaller.org/

SQLite can be installed normally too. SQLite也可以正常安装。

Original post: (2010-01-25) 原帖:(2010-01-25)

The best way to start is using the one-click installer. 最好的方法是使用一键安装程序。 I advise using the older installer ( http://rubyforge.org/frs/download.php/47082/ruby186-27_rc2.exe ) instead of the new RubyInstaller, because the latter is still a bit immature. 我建议使用较旧的安装程序( http://rubyforge.org/frs/download.php/47082/ruby186-27_rc2.exe )而不是新的RubyInstaller,因为后者仍然有点不成熟。 While installing select rubygems support and the add ruby to the PATH option, to ease access to ruby binaries. 安装select ruby​​gems支持并将ruby添加到PATH选项时,可以轻松访问ruby二进制文件。

After installing (takes a while), fire a console, and install rails (and a database connector, like sqlite3) using the commands 安装(需要一段时间)后,启动控制台,并使用命令安装rails(和数据库连接器,如sqlite3)

gem install rails
gem install sqlite3-ruby –version=1.2.3

(the 1.2.3 version of the sqlite3 gem will work on windows correctly) (1.2.3版本的sqlite3 gem将正确地在Windows上运行)

As you have guessed correctly gems are modules to ruby, and ruby on rails is one of these modules. 正如你猜测的那样,gems是ruby的模块,而rails上的ruby就是这些模块之一。

Now you have installed both ruby and rails, fire up a console, and type 现在你已经安装了ruby和rails,启动了一个控制台,然后输入

rails applicationname

to create your first rails application. 创建你的第一个rails应用程序。 From here on read the tutorials and documentations. 从这里开始阅读教程和文档。

Rails doesn't really need an IDE for development, you can use any decent text editor, but there are rails plugins for IDEs like eclipse, and editors like vim or emacs. Rails并不需要用于开发的IDE,你可以使用任何体面的文本编辑器,但是有像eclipse这样的IDE的rails插件,以及像vim或emacs这样的编辑器。

回答IDE部分:除了一个好的纯文本编辑器(已经建议使用vim和emacs)之外,我发现netbeans IDE工作得非常好,特别是在Windows上。

This page works fine and installs on Windows recent releases (mid-2011) of the entire toolset: 页面工作正常,并安装在整个工具集的Windows最新版本(2011年中):

  1. Ruby 1.9.2-p290, Ruby 1.9.2-p290,
  2. Rails 3.1, Git 1.7.6, Rails 3.1,Git 1.7.6,
  3. Sqlite 3.7.3. Sqlite 3.7.3。

Ruby Eclipse support is here Ruby Eclipse支持就在这里

Configure to use it in Window/Preferences/Ruby/Interpreters/Add (RailsInstaller Windows default is C:\\RailsInstaller\\Ruby1.9.2\\bin\\ruby.exe) 配置在Window / Preferences / Ruby / Interpreters / Add中使用它(RailsInstaller,Windows默认为C:\\ RailsInstaller \\ Ruby1.9.2 \\ bin \\ ruby​​.exe)

  1. Create File/New/Project/Ruby/Ruby Project and 创建文件/新建/项目/ Ruby / Ruby项目和

  2. add File/New/Empty Ruby Script. 添加文件/新建/清空Ruby脚本。

  3. type puts "Hello, Ruby" and 输入puts "Hello, Ruby"

  4. click Run and select Ruby Script. 单击Run并选择Ruby Script。

Read the Console and enjoy. 阅读控制台并享受。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM