Search code examples
ruby-on-railsruby-debug

Ruby-debug not working


I can't get the server to start in debugging mode:

even though I have all of the correct gems installed, the server refuses to start.

$ gem install ruby-debug
ERROR:  Error installing ruby-debug:
       rbx-require-relative requires Ruby version ~> 1.8.7.

which doesn't work, other posts say to use ruby-debug19:

David@DAVID-PC /c/triton6 
$ gem install ruby-debug19
Successfully installed ruby-debug19-0.11.6
1 gem installed
Installing ri documentation for ruby-debug19-0.11.6...
Installing RDoc documentation for ruby-debug19-0.11.6...

David@DAVID-PC /c/triton6 
$ rails server --debug
=> Booting WEBrick
=> Rails 3.1.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install > ruby-debug' 
Exiting

Any idea what to do?

Here is my Gemfile:

source 'http://rubygems.org'

gem 'rails', '3.1.3'

# Bundle edge Rails instead:
# gem 'rails',     :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'
gem 'ruby-debug19'
gem 'execjs'
gem 'ruby-debug-ide'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails',   '~> 3.1.5'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

group :test do
# Pretty printed test output
gem 'turn', '0.8.2', :require => false
end

Solution

  • Make sure you have gem "ruby-debug19", :require => 'ruby-debug' in your Gemfile, then run bundle install :)

    Edit: Added the important :require => statement, which I missed before