Rails’ Breakpoint does not work in Ubuntu Feisty (ruby version problem)

Ruby 1.8.5 is installed by default in Ubuntu Feisty, this version presents some problems when you try to program with Rails. If you want to debug your application using breakpointers, Webrick will abort showing the following message:

Breakpoints are not currently working with Ruby 1.8.5

RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full Trace

vendor/rails/railties/lib/breakpoint.rb:21:in `of_caller'
vendor/rails/railties/lib/breakpoint.rb:543:in `breakpoint'
app/controllers/books_controller.rb:19:in `show'

In order to avoid this problem, I’ve downgraded my ruby version to the one used in Edgy (the previous version of Ubuntu). Concretely, it is necessary to downgrade this packages:

ruby
ruby1.8
libruby
libruby1.8
irb1.8
libreadline-ruby1.8
rdoc1.8

After we have downloaded those packages, we can install them by:

dpkg -i irb1.8_1.8.4-5ubuntu1.2_all.deb libruby_1.8.2-1_all.deb ruby_1.8.2-1_all.deb
            libreadline-ruby1.8_1.8.4-5ubuntu1.2_i386.deb doc1.8_1.8.4-5ubuntu1.2_all.deb
            libruby1.8_1.8.4-5ubuntu1.2_i386.deb ruby1.8_1.8.4-5ubuntu1.2_i386.deb

Finally, we have to indicate that we do not want to upgrade those packages by editing ‘/etc/apt/preferences’ (more info):

Package: irb1.8
Pin: version 1.8.4*
Pin-Priority: 1001

Package: libreadline-ruby1.8
Pin: version 1.8.4*
Pin-Priority: 1001

Package: libruby1.8
Pin: version 1.8.4*
Pin-Priority: 1001

Package: ruby1.8
Pin: version 1.8.4*
Pin-Priority: 1001

Package: rdoc1.8
Pin: version 1.8.4*
Pin-Priority: 1001

2 thoughts on “Rails’ Breakpoint does not work in Ubuntu Feisty (ruby version problem)

Leave a Reply

Your email address will not be published. Required fields are marked *