最近在看Metasploit要用到ruby寫exploit,配置下eclipse來開發ruby
RDT(Ruby Development Tool)下載地址:
http://jaist.dl.sourceforge.net/sourceforge/rubyeclipse/org.rubypeople.rdt-0.7.0.601192300PRD.zip
ruby在安裝Metasploit的時候已經安裝好了,現在只需配置下Eclipse.
1.解壓該文件,獲得features和plugins兩個文件夾,將這兩個文件夾複製到eclipse的安裝目錄下(把這兩個文件夾的文件分別拷貝到esclipse相應的文件夾裏即可,物品拷貝到dropins文件夾下了),即可完成RDT的安裝。
2.設置RDT,Ruby是一種解釋型語言,在eclipse中必須將其與某種環境管理起來,才能夠運行Ruby腳本。在eclipse的windows—preferences菜單中,點擊左側的Ruby/Installed interpretes節點,點擊界面中的Add按鈕,在Location中將其指向Ruby安裝目錄下的bin目錄。例如我的目錄是C:\ruby\bin\ruby.exe。點擊確定完成設置
3.在eclipse中對Ruby說hello world。點擊新建按鈕,新增一個projects,這時在列表中能看到Ruby節點,點擊finished新增,然後在項目節點上點擊右鍵,選擇file,新增一個hello.rb文件,在文件中輸入如下代碼:
puts "hello,world"
然後在hello.rb文件上右鍵——Run as——Ruby application,然後在console中就能看到輸出結果:hello,world了。
可以正常輸出不過會出現如下警告,但不影響編譯
“cygwin warning:
MS-DOS style path detected: E:/project/java code/rubycode/hello.rb
Preferred POSIX equivalent is: /cygdrive/e/project/java code/rubycode/hello.rb
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames”
要去掉這個警告可以在系統裏設置一個環境變量
CYGWIN=nodosfilewarning;
至此就OK了