This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 154548 - Netbeans is unable to debug Rails/Merb application
Summary: Netbeans is unable to debug Rails/Merb application
Status: RESOLVED WORKSFORME
Alias: None
Product: ruby
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: All Linux
: P1 blocker (vote)
Assignee: Martin Krauskopf
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-04 01:58 UTC by dmilith
Modified: 2009-02-19 23:01 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dmilith 2008-12-04 01:58:07 UTC
I'm using JRuby 1.1.5 (trunk from git), I've installed ruby-debug-ide gem for JRuby ( 0.3.2 like in wiki ).
I was able to run Debug mode only once. (after restarting netbeans I'm receiving information like this:
http://haystack.pl/wtf.png)
But even first time when application started in debug mode, i was unable to get ANY info from application code. All
debug windows (stack, variables, call stack and so on) were clear.
No matter which ruby i used. Both CRuby 1.8.6 and JRuby 1.1.5 cannot get debug mode although I can run them in normal
Run mode. (and it works ok!)
Comment 1 Erno Mononen 2008-12-04 07:40:37 UTC
Merb support is coming (issue 132265), passing this to Martin for further evaluation. Do you mean you can't debug an 
application that uses both Merb and Rails or that you can't debug either Merb or Rails applications? 
Comment 2 dmilith 2008-12-04 09:18:24 UTC
No matter Rails or Merb. I've hacked a bit my merb application to imitate rails project anyway. Nothing works.
(including all wiki issues from trubbleshotting)
Comment 3 Martin Krauskopf 2008-12-04 09:30:18 UTC
Could you provide detailed logging as described here:

   http://wiki.netbeans.org/FaqRubyNBLogging

There are not any known bugs in the meantime. Thanks.
Comment 4 dmilith 2008-12-04 09:47:47 UTC
./netbeans -J-Dorg.netbeans.modules.ruby.level=400 -J-Dorg.netbeans.api.ruby.platform.level=400
throws nothing.

after ading those params to netbeans.conf
throws nothing.

I tried with running rails/merb apps on Mongrel, Glassfish GEM and built in Glassfish v3

absolutely nothing in console log.

I will try with new config. Maybe I have something messed up in my ~/.netbeans/6.5
Comment 5 Martin Krauskopf 2008-12-04 09:50:44 UTC
Actually I meant:

   http://wiki.netbeans.org/RubyDebugging#section-RubyDebugging-HowToFileABug

there are more logging flags. The logging should be available in 'Menu -> View -> IDE Log File' (or directly
$YOUR_NB_USER_DIR/var/log/messages.log) as described in the above link.
Comment 6 dmilith 2008-12-04 10:02:20 UTC
ok. sorry. I thought it will be thrown on console..
here are the files from running rails app only (first with GF gem, second with mongrel. it seems to use GF v3 anyway?):
http://haystack.pl/nb/messages.log
Comment 7 dmilith 2008-12-04 10:25:06 UTC
INFO [org.netbeans.modules.j2ee.deployment.impl.ServerInstance]: DebuggerInfo cannot be found for: GlassFish V3
although i didn't use glassfish to run. it's in every log i tried (no matter rails/ merb app)
Comment 8 Martin Krauskopf 2008-12-04 10:30:36 UTC
I see that you've tried only with the Glassfish, when having logging turned on. Do you have problem only with Glassfish
debugging, or with Rails in general? If later, could you also provide a log where you've unsuccessfully tried with Rails
without Glassfish. Glassfish debugging is not in my competence, but if it is general, it is likely bug somewhere lower
in the layers.
Also I suppose that debugging of simple *non*-Rails application works for you. If not the best would be to have a log
with simple 'Hello World' non-Rails app (easier to analyze).
Comment 9 dmilith 2008-12-04 10:32:08 UTC
Ok problem solved after removing ~/.netbeans/6.5 dir. But is it possible to find out what is wrong with old settings?
(i've customized nb a bit..)
Comment 10 dmilith 2008-12-04 10:42:14 UTC
uh. i did not! only glassfish GEM or Mongrel. GF v3 isn't compatible with merb apps. GF GEM and mongrel are.
Comment 11 dmilith 2008-12-04 11:14:13 UTC
Fast Debugger (ruby-debug-ide 0.3.2) listens on localhost:49622
Loading init file from /home/dmilith/Projects/drAdmin/config/init.rb
Loading /home/dmilith/Projects/drAdmin/config/environments/development.rb
 ~ Connecting to database...
 ~ Using ActiveRecord sessions
 ~ Loaded slice 'MerbAuthSlicePassword' ...
The signal USR1 is in use by the JVM and will not work correctly on this platform
 ~ Compiling routes...
 ~ Activating slice 'MerbAuthSlicePassword' ...
merb : worker (port 4002) ~ Starting Mongrel at port 4002
merb : worker (port 4002) ~ Successfully bound to port 4002

so NB with JRuby is working properly with Merb. There's only one hack to be done by adding script dir and server script
inside, with content:

#!/usr/bin/env ruby
require 'rubygems'
version = ">= 0"
if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
  version = $1
  ARGV.shift
end
gem 'merb-core', version
load 'merb'

regards
dmilith
Comment 12 Martin Krauskopf 2008-12-04 11:58:47 UTC
> Ok problem solved after removing ~/.netbeans/6.5 dir. But is it possible to find out what is wrong with old settings?

I don't know. I'm trying to CC Peter whether he is able to read something from the log. There seems to be some
misconfiguration wrt. Glassfish.

> so NB with JRuby is working properly with Merb. There's only one hack to be done

Thanks for the tip. I'm not Rails/Merb guy, but it could be handy to have this tip in the wiki:

  http://wiki.netbeans.org/RubyFAQ#section-RubyFAQ-Rails

Can you (or Erno?) add it there. I know almost nothing about Merb.

For 7.0 there is plan to bring the Merb support but until then this might be useful for 6.5 users.

So closing for now, reopen of file a new issue if you hit something else. Thanks.
Comment 13 dmilith 2008-12-04 12:01:51 UTC
already done:
http://wiki.jruby.org/wiki/Merb_debugging_with_Netbeans_6.5
Comment 14 Erno Mononen 2008-12-04 12:23:15 UTC
Great, thanks! I linked to it from http://wiki.netbeans.org/RubyFAQ#section-RubyFAQ-Merb.
Comment 15 _ pcw 2008-12-04 18:30:45 UTC
First netbeans log ( from http://haystack.pl/nb/messages.log ) actually shows both GlassFish and Mongrel failing in the
same way.

I guess the user patched Mongrel and it works, maybe V3 GEM needs it's own patch.  I'll ask the GlassFish guys if
they've tried Merb debugging in NetBeans.

I'm temporarily on another project right now, so I have not tried the new V3 GEM with NetBeans myself.  I also haven't
tried debugging in V3 with JRuby 1.1.5 either and that could also affect things (though since Mongrel didn't work at
first either, this seems doubtful).