Last Updated: February 25, 2016
·
1.883K
· Jeroen Rosenberg

How to debug rails in IntelliJ on ubuntu

I noticed debugging rails apps in IntelliJ doesn't work out-of-the-box on ubuntu. Here are the steps that fixed the problem for us:

I. Download ruby and linecache

wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.3-p0.tar.gz
wget http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem

II. Extract ruby

tar -xf ruby-1.9.3-p0.tar.gz

III. Install gems

sudo gem install linecache19-0.5.13.gem -- --with-ruby-include=ruby-1.9.3-p0
sudo gem install ruby-debug-base19x --pre -- --with-ruby-include=ruby-1.9.3-p0
sudo gem install ruby-debug19 -- --with-ruby-include=ruby-1.9.3-p0
sudo gem install ruby-debug-ide --pre -- --with-ruby-include=ruby-1.9.3-p0

IV. Happy debugging

Now you should be able to run the debugger from any Ruby module