views:

43

answers:

1

When using RVM with ruby 1.8.7 I am unable to run the debugger. I am using rails 2.3.9 and mongrel

script/server --debugger

returns: You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'

this is what my gem list looks like: ruby-debug (0.10.3) ruby-debug-base (0.10.3)

+1  A: 

Do you have rvm configured correctly?

Run which gem to check you are using the rvm version of gem. When you run gem install ruby-debug, what happens?

Check the permissions on the files/folders in your $GEM_HOME as well to make sure they are readable by you - I've had problems with gems being installed as root read-only before.

Edit

Try running sudo ./script/server --debugger to make sure it isn't a permissions issue.

Can you debug a basic ruby script successfully?

$ cat test.rb
#!/path/to/ruby
debugger
puts 'Hello world'
$ rdebug /path/to/test.rb

Can you run rdebug ./script/server?

nfm
which gem:../.rvm/rubies/ruby-1.8.7-p302/bin/gemgem install ruby-debug: Successfully installed ruby-debug-0.10.3I also have read permissions on all those folders
Nicolo77
You shouldn't use sudo with RVM, if you need to sudo on a ruby action with RVM installed, you'll want to use `rvmsudo`
phsr
sudo ./script/server --debugger worksIs that still using rvm 1.8.7 or is it using rvm system?I can get it to work using rvm system already
Nicolo77
Oops, yeah using `sudo` would use system gems. Could you run the debugger over a script (ie outside of the Rails framework)?
nfm