Debugging JavaScript from RubyMine

I have a Sinatra project that is almost just three files:
One service.rb file that is for the Sinatra project.
One Index.html file
One javascript file that calls the web services that are in the serivce.rb file, gets their JSON and with some JavaqScript magic! draw the charts for them, etc...

I open this project , right click on the service.rb file and pick Run or Debug option and it starts the service, I can open my home page and see the charts, etc...even put break points insde the "service.rb" file adn see their values, etc...

But now I wanted to put break points in the Javascript file and debug that one inside RubyMine.  Is that possible or I should just use the normal browser debugger out of RubyMine

I put some break points in the JS file, again had to click on the Service.rb file to start the service in Debug mode and when I went to the web page, it didn't break on any break points in the JS file.  What settings or work flow I am missing? What is the correct way of doing this?

Thanks.



Attachment(s):
Screen Shot 2013-05-14 at 8.20.25 AM.png
3 comments

Hello Bond, James Bond,

It's possible debug JavaScript code in your case. You need to create run configuration "JavaScript Debug Remote" and specify remote url for the directory with javascript file.

You could get more details here: http://www.jetbrains.com/ruby/webhelp/debugging-javascript.html#d63049e12233

0

Please take a look at this screen shot and see if JS debugger is running?  
There is a check mark on the break point so does that mean JS debugger is enabled and is working?

But why it doesn't break on those break points?

I first ran Rails dev in the normal mode to bring up the site
Then switched the confiuration to JS debugging and ran it again in debug mode of JS debugger.


Thanks.



Attachment(s):
Screen Shot 2013-05-23 at 8.22.59 AM.png
0

Please sign in to leave a comment.