ruby的安裝&eclipse 中的外掛程式安裝

來源:互聯網
上載者:User

 1.1 安裝Ruby One-Click Installer, 下載頁面http://www.ruby-lang.org/en/downloads/

1.2 安裝Rails, Windows CMD(開始-->運行-->cmd) 中運行"gem install rails --include-dependencies" ,自動安裝。

eclipse 安裝ruby外掛程式

 

 建議通過eclipse更新安裝來遠程安裝外掛程式。
   從eclipse的菜單Help->Software Updates->Find and Install
   選擇"Search for new features to install" 進行安裝。
   
   需要安裝的有兩個外掛程式:
   1,RDT
          http://updatesite.rubypeople.org/release   2,RadRails
    http://radrails.sourceforge.net/update   安裝完成後需要設定一下ruby解譯器的位置。

   通過eclipse菜單 Windows > Preferences 開啟Preferences對話方塊,在Ruby 標題下面的 Installed Interpreters 項中設定的ruby的位置。

2.1 配置Ruby

2.1.1配置Interpreters
開啟"Windows-->Preferences", 選擇"Ruby-->Installed Interpreters" , 點擊"Add"出現的提示框中

代碼
  1. //any name you like   
  2. Interpreters Name: Ruby    
  3. Location: D:/ruby/bin/ruby.exe   

<script>render_code();</script>

 

2.1.2配置Ri/rdoc
開啟"Windows-->Preferences", 選擇"Ruby-->Ri/rdoc"

代碼
  1. //bin目錄下面的rdoc檔案,沒有副檔名,不是rdoc.bat   
  2. RDoc path: D:/ruby/bin/rdoc   
  3. //bin目錄下面的ri檔案,沒有副檔名,不是ri.bat   
  4. Ri path: D:/ruby/bin/ri   

<script>render_code();</script>

 

2.2 配置Rails和Rake
開啟"Windows-->Preferences", 選擇"Rails-->Configuration"

代碼
  1. //bin目錄下面的rails檔案, 沒有副檔名, 不是rails.bat   
  2. Rails Path: D:/ruby/bin/rails   
  3. //bin目錄下面的rake檔案, 沒有副檔名, 不是rake.bat. 如果沒有rake檔案,運行gem update rake(安裝) 或者 gem install rake(升級)    
  4. Rake Path: D:/ruby/bin/rake   
  5. //bin目錄下面的mongrel_rails檔案, 沒有副檔名. 如果沒有,運行gem install mongrel 安裝   
  6. Mongrel Path: D:/ruby/bin/mongrel_rails   

<script>render_code();</script>

 

3. 總結
安轉RadRails很簡單,但是配置還是很容易出問題, 特別是幾個path, 除了ruby.exe有副檔名以外, 其他的都沒有副檔名. 初學者很容易出問題, 再次強調一遍

 
  這樣,ruby環境這完成了。 在eclipse中建立一個ruby的工程,再建一個ruby檔案,寫上 puts "OK" 就可以看到eclipse的控制台輸出ok資訊了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.