The documentation on getting rails server --debug
working with the Software Collections (SCL) version of Ruby is a little weak. So here's how to do it. If you installed SCL ruby193 you'll probably get this error when you try to start the debugger:
/usr/share/foreman$ rails server --debug
=> Booting WEBrick
=> Rails 3.2.8 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
The great part though is that ruby-debug doesn't exist for Ruby 1.9.3. The gem you want is 'debugger' and the 'debugger' gem isn't packaged up with SCL ruby193. To get it, first setup the v8314 SCL repo which is required for ruby193-ruby-devel. Then install these:
yum install ruby193-ruby-devel gcc
scl enable ruby193 bash
gem install debugger
After those packages, debugger should start working
/usr/share/foreman$ RAILS_ENV=development ruby193-rails server --debug
=> Booting WEBrick
=> Rails 3.2.8 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
=> Debugger enabled
[2014-09-23 17:33:55] INFO WEBrick 1.3.1
[2014-09-23 17:33:55] INFO ruby 1.9.3 (2013-11-22) [x86_64-linux]
[2014-09-23 17:33:55] INFO WEBrick::HTTPServer#start: pid=26604 port=3000
Great!