Rails 3.2 - Getting a Debugger Working on Ubuntu 11.04

March 23, 2012


UPDATE May 2012: The new 'debugger' gem just works. Just add gem 'debugger' to your Gemfile and you can ignore all this... ;)


I had a lot of trouble getting ruby-debug19 working on my Ubuntu 11.04 development virtual machine. I don't totally understand the details, but I think linecache19 was trying to write to some ssl-related directory which it didn't have permissions for. I tried everything suggested in this thread, but nothing worked for me.

I finally decided to delete the entire .rvm directory and start over. When I tried that (as non-sudoer) I got a message that I didn't have permission to delete some ssl-related directories. That was my main problem all along (I think I must have accidentally installed the ssl libraries as a system user at some point). After re-installing rvm, but before installing ruby 1.9.3, I installed openssl like this:
rvm pkg install openssl
Then I installed ruby 1.9.3 and set up my gemfile like this:
gem 'linecache19', :git => 'git://github.com/mark-moseley/linecache', :group => [:development, :test]
gem 'ruby-debug-base19x', '~> 0.11.30.pre4', :group => [:development, :test]
gem 'ruby-debug19', :require => 'ruby-debug', :group => [:development, :test]
Bundle install worked -- and so did ruby debug! The specific versions of linecache19 and ruby-debug-base19x were necessary to prevent a ruby_threadptr_data_type_error as explained here.

I specified the group for these so they can be excluded from the production server (linecache19 won't install at webfaction either). To make that exclusion work, I also needed to modify my Capistrano deploy.rb to pass bundle install a config option as follows:
namespace :gems do
  desc "Install gems"
  task :install, :roles => :app do
    run "cd #{current_release} && bundle install --without development test"
  end
end

Feedback

Your feedback is welcome! If you find any errors in this post or have any additional pointers or insights, please take a moment to register and share your thoughts.



No Comments Yet

You must be logged in to comment

All Posts