You are the best one!!

安装Ruby for Eclipse 开发环境

上一篇 / 下一篇  2012-02-08 11:07:03 / 个人分类:Ruby/Watir Space

1. 下载Rubyhttp://www.ruby-lang.org/en/downloads/。 之前下过install版本ruby186-26.exe,就直接安装。安装完后,go to RubyGem Package Manager, use command $gem update --system 更

新最新版Gem, 更新完后,看到最新版本RubyGems 1.8.16 installed。
 
2. 下载Eclipse:http://www.eclipse.org/downloads/。下了个最全的package,eclipse-jee-indigo-SR1-win32.zip。只要解压,无需安装。

3. 下载JDK(Java Develop Kit):jdk-7-windows-i586.exe,直接运行,安装完后JDK版本是1.7.0。
   Note:只有装好JDK后,eclipse才能正常运行。

4. Install Ruby Development Tools(RDT) for eclipse。以前是有地方下的,现在好像没有了。不过网站提供在线下载。方法:打开eclipse, Help->Install New Software, 在work with里输入:http://download.aptana.com/studio3/plugin/install,然后Enter。接下来一路next就好了。这里要下载很长的时间,有时网络不好。
    Note: 要使用Eclipse开发ruby,必须安装RDT plugin。安装好以后,打开eclipse,在File->New中可以看到Ruby Project。

5. 安装ie的自动化API - Watir

三、配置Ruby for Eclipse环境:

1. 我使用的Ruby版本是1.86,Eclipse版本是3.3.1,安装完成基本上不用再做任何配置,打开Eclispe>Windowns>Preferences>Ruby>Installed Interpreters,可以看到缺省已经设置了JRuby做为虚拟机;

2. 如果你希望使用原生的Ruby做为虚拟机,则可以点击“Add”按钮设定Ruby的运行目录。到此时设置即告完成,不必像先以前的版本那样设置其它的系统路径。

四、Hello Ruby:

1. 选择菜单Eclispe>New>Project>Ruby>Ruby project,建立一个Ruby工程“HelloRuby”;

2. 在新建的Ruby工程上右击鼠标,选择New>Ruby Class,建立一个新的Ruby类,类名为HelloRuby;

3. 在新类中写入下列代码,Hello Ruby就完成了。在工程上右击菜单Run as>Ruby Application即可输出结果。

class HelloRuby
print "Hello Ruby!"
end


TAG:

 

评分:0

我来说两句

日历

« 2024-05-01  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 29226
  • 日志数: 35
  • 文件数: 2
  • 书签数: 2
  • 建立时间: 2008-06-07
  • 更新时间: 2014-08-04

RSS订阅

Open Toolbar