Reputation: 11
I have a bug in my application which is only happening on 'stage' but not locally. I would like to use a debugger and set a breakpoint so I can debug the application on stage.
Locally I use pry and even got the pry-remote to work locally but couldn't get it to work on the server.
I don't mind using the regular debugger or pry for the debugging.
The problem I am usually hit with: ArgumentError (non-absolute home)
Thanks.
Upvotes: 1
Views: 255
Reputation: 176552
One solution to reproduce the error locally is to start your server in the same environment that is failing.
$ RAILS_ENV=staging script/server
Upvotes: 0
Reputation: 6501
If you're definitely not putting this out into a production environment while you're testing it, I would recommend the better_errors
Gem. It's definitely not for a production site though as it would expose some serious security issues
If you include it in the :development
group it will give you a console in the webpage whenever an error is occurring.
If it's not raising a fatal error, then you can throw the raise
method anywhere you want to act like a breakpoint, you won't be able to continue on, but it's useful to help do pry like stuff in the webpage.
There's a good guide by Ryan Bates
http://railscasts.com/episodes/402-better-errors-railspanel
Upvotes: 1