Set up ruby debugging environment

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/

 

转载于:https://www.cnblogs.com/LevinJ/p/4608522.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值