How do developers who use VIM or Textmate debug their Python/Ruby/PHP code, both in command line mode and when running through a local Web Server such as Apache?
-
I am in the proces of migrating from IDEs to lighter editors. I have already found a comfortable way to debug my C++ code through CGDB, I was wondering how to go about it with my script languages both in command line (I found pdb for Python, but I was wondering of there are other options) and when running them on my local web server.
-
Answer:
When i'm developing a ruby or rails app i always put the ruby-debug gem in my Gemfile so that i can put breakpoints in my code and trace the executing using rdebug Here are some resources for Ruby and Rails: http://guides.rubyonrails.org/debugging_rails_applications.html http://cheat.errtheblog.com/s/rdebug/
Adam Schepis at Quora Visit the source
Other answers
I debug python using ipdb. For example, to debug a Django view, I might insert import ipdb; ipdb.set_trace() into the code where I want a breakpoint, then run the local development server and proceed to debug it intractively in the terminal. I don't really use ruby, but I expect the procedure is fairly similar. For PHP you could use something like XDebug, but I've never actually seen it work (either it crashes apache or it just doesn't run). So I just make sure I log everything and then tail the logs. Or during development just var_dump things as I go. That and write tests, right?
Ben Sinclair
Related Q & A:
- How can I restore Sharepoint web app when the DB is in another server?Best solution by SharePoint
- How can I debug my php code?Best solution by Stack Overflow
- How to do a local mysql database replication on an online server?Best solution by howtoforge.com
- How can I make a dynamic web page in PHP?Best solution by Yahoo! Answers
- How to start a local Server on Windows Platform?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.