1、下载并安装ruby20111229-1559-sfx.exe(E:\开发包)
把ruby加入环境变量Path中:e:\Ruby193\bin;
----------------------------
2、下载并双击解压DevKit-tdm-32-4.5.2-20110712-1620-sfx.exe(E:\开发包)
----------------------------
3、安装并测试,cd到步骤2的解压目录下:
----C:\DevKit>ruby dk.rb init
[INFO] found RubyInstaller v1.9.3 at C:/Ruby193
Initialization complete! Please review and
modify the auto-ge
'config.yml' file to ensure it contains the root directories
of the installed Rubies you want enhanced by the DevKit.
----C:\DevKit>ruby dk.rb install
[INFO] Updating convenience notice gem override for 'C:/Ruby1
[INFO] Installing 'C:/Ruby193/lib/ruby/site_ruby/devkit.rb'
----C:\DevKit>gem install rdiscount --platform=ruby
Fetching: rdiscount-1.6.8.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed rdiscount-1.6.8
1 gem installed
Installing ri documentation for rdiscount-1.6.8...
Installing RDoc documentation for rdiscount-1.6.8...
----------------------------
4、安装thrift
C:\DevKit>gem install thrift
----------------------------
5、安装ruby的eclipse插件:
help->install new software->
路径:http://download.eclipse.org/technology/dltk/updates/
-->Dynamic Languages Toolkit (DLTK) 2.0
-->Dynamic Languages Toolkit - Ruby Development Tools 2.0.0.v20100505-1154-7G--E_EkMU3NHhvAUo0G
-->Dynamic Languages Toolkit - Ruby Development Tools SDK 2.0.0.v20090730-1127-4--84L23HCMnUW7RPoxKoq2YAFlN
----------------------------
6、在eclipse中设置ruby环境:
window->preference->Ruby->interpreters
add ruby.exe,路径为步骤1的ruby开发包中(E:\Ruby193\bin\ruby.exe)
----------------------------
在eclipse运行ruby test:
右键单击/weiboTestAuto/test.rb,
run as->run configurations->ruby script,
new一个configuration,在arguments中填入运行参数:
-s test/testRecmdServer.rb(测试ruby
脚本) -r resource/testRecmdServerRes.rb(资源ruby脚本) -m getUserList(方法名) -o abc(测试结果输出
文件名)
run