Today I finally got ruby debugging working in Eclipse. Below are the major setup steps involved, as well as some problems one might encounter along the way.
1. Install DLTK plugin
To make Eclipse a Ruby IDE, one popular plugin to be installed is, "Dynamic Languages Toolkit - Ruby Development Tools ", as shown below:
2. Install Ruby and development kit
Eclipse uses a “debugger” gem as debugging engine, which empowers eclipse to debug ruby. Unfortunately this “debugger” gem has some limitations; it only works under some particular versions of ruby out of the boxes, as indicated in below link:
https://github.com/cldwalker/debugger#known-issues
The RubyInstaller Development Kit (DevKit) is a MSYS/MinGW based toolkit than enables you to build many of the native C/C++ extensions available for RubyThe RubyInstaller. One of the challenges many Ruby on Windows users have is how to easily use native RubyGems from the community such as the rdiscount or curb gems. In many cases this isn’t a problem because the extension author has provided a binary gem compatible with the users Ruby environment. In other cases, only the extension source code is available in the gem and the user is expected to have a “sane” environment installed and configured in order to build and use the native gem. A “sane” environment typically means a system with make, gcc, sh and similar *nix build tools installed.
This expectation of a “sane” build environment is not always true for Windows users and is the primary reason why the DevKit was created. The DevKit, based upon MSYS and MinGW components, is an easy-to-install and easy-to-use solution for quickly setting up a “sane” build environment, enabling you to use most native RubyGems developed by the Ruby community.
For me, I used below versions of ruby and its development kit.
l Ruby 1.9.3-p550Ruby 1.9.3-p550
l DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe
3. Install debugger gem
Install the gem quite easy,
Just type:
gem install debugger
In some areas/countries, the default gem source is blocked. As a result, below error will occur
Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: Connection refused - connect(2)
you can use other sources like that from taobao.
gem sources -a http://ruby.taobao.org/
gem sources -r https://rubygems.org/
4. Configure ruby interpreter in eclipse
Set up appropriate version of ruby you want Eclipse to run/debug your ruby scritps.
5. Done
6. Reverences and links
1) Ruby download link
http://rubyinstaller.org/downloads/archives
2) Ruby development link download
http://rubyinstaller.org/downloads/