最近根据网上的资料搭建了一个Ruby on Rails环境。但是还没有使用,不知道能不能用,下面就写写过程,免得以后忘记
数据库:mysql5.0
操作系统:windowsXP
以下步骤使用了网友“海啸南风”的做法,只不过省去了第2步
1. 下载最新的ruby 1.8.6一键安装包
a. http://rubyforge.org/frs/download.php/18566/ruby186-25.exe
下载后,一键安装。这个安装的是ruby环境,还要搭建rails的环境。
2. 安装 rubygems-0.9.2(可选)
a. http://rubyforge.org/projects/rubygems/
下载后解压出来,然后在“命令提示符”(就是dos方式)下进入到解压目录执行 ruby setup.rb
3. 挨个下载rail套件(only gem)
从http://rubyforge.org逐个下载Rails框架所需的各个安装包,这种方法比较麻烦,但是能够保证安装成功。
需要下载的安装如下
a.activesupport-1.4.2(下载地址http://rubyforge.org/projects/activesupport)
b.activerecord-1.15.3(下载地址http://rubyforge.org/projects/activerecord/)
c.actionpack-1.13.3(下载地址http://rubyforge.org/projects/actionpack/)
d.actionmailer-1.3.3(下载地址http://rubyforge.org/projects/actionmailer/)
e.actionwebservice-1.2.3(包下载地址http://rubyforge.org/projects/aws)
f.rail-1.2.3 (http://rubyforge.org/projects/rails/)
4. 按顺序install以上gem
gem install activesupport-1.4.2.gem
gem install activerecord-1.15.3.gem
gem install actionpack-1.13.3.gem
gem install actionmailer-1.3.3.gem
gem install actionwebservice-1.2.3.gem
gem install rails-1.2.3.gem
5.安装mysql
6.为Ruby添加mysql驱动
这一步很重要:在mysql的安装目录下有一个bin目录,bin目录下有一个libmysql.dll,要把这个文件拷贝到ruby\bin目录下。
接下来安装IDE
Note: This version requires Sun JVM 1.5 or later.
Note: Currently, this bundled version is only available for Mac and Windows. A Linux version is coming soon.
To install a bundled version of Aptana Milestone 8a and RadRails:
Install Aptana:
-
- Go to the RadRails download page and download and save the appropriate installer or zip file to your hard drive:
http://www.aptana.com/download_rails_rdt.php 、http://download1.aptana.com/downloads/current/Windows/Aptana_IDE_Setup_Windows.zip
-
Double-click the installer to install Aptana. (If you are using the zip file version, unzip the file contents into the directory where you want to install Aptana.)
- Go to the RadRails download page and download and save the appropriate installer or zip file to your hard drive:
- Install RadRails:
- Start the Aptana IDE.
- From the Help menu, select Software Updates > Find and Install... to open an Install/Update window.
- On the Install/Update window, choose the Search for New Features to Install option, and click the Next button.
- Check the box next to Ruby on Rails Development Environment and click the Finish button.
- Follow the dialogue prompts to complete your installation.