| View previous topic :: View next topic |
| Author |
Message |
bkocik
Joined: 03 Oct 2008 Posts: 26
|
Posted: Wed Sep 01, 2010 12:13 pm Post subject: At my wit's end (debugging a Rails 3.0/Ruby 1.9.2 app) |
|
|
Hi folks -
I spent most of yesterday looking around these forums trying to get NB 6.9 to debug my Rails 3.0 app running with Ruby 1.9.2 (installed via rvm). When I try to run my app in debug mode I get this error:
Fast Debugger (ruby-debug-ide 0.4.9) listens on :53116
/Users/wkocik/.rvm/gems/ruby-1.9.2-p0/gems/ruby-debug-ide19-0.4.12/lib/ruby-debug-ide.rb:123:in `debug_load'
/Users/wkocik/.rvm/gems/ruby-1.9.2-p0/gems/ruby-debug-ide19-0.4.12/lib/ruby-debug-ide.rb:123:in `debug_program'
/Users/wkocik/.rvm/gems/ruby-1.9.2-p0/gems/ruby-debug-ide19-0.4.12/bin/rdebug-ide:87:in `<top (required)>'
/Users/wkocik/.rvm/gems/ruby-1.9.2-p0/bin/rdebug-ide:19:in `load'
/Users/wkocik/.rvm/gems/ruby-1.9.2-p0/bin/rdebug-ide:19:in `<main>'
Uncaught exception: no such file to load -- script/rails
It seems odd to me that it mentions ruby-debug-ide 0.4.9; I don't even have that gem installed:
wkocik$ gem list -d ruby-debug-ide
*** LOCAL GEMS ***
ruby-debug-ide19 (0.4.12)
I've added -J-DrubyDebugIDEName=ruby-debug-ide19 to my netbeans_default_options in netbeans.conf. This hasn't solved it, though it has changed its behavior. Before I did that the debugger failed to start, but showed no message. Looking at NB's log I found it was looking for, and failing to find, the ruby-debug-ide 0.4.9 gem.
I also replaced my org-netbeans-modules-ruby-debugger.jar file with one that Erno posted in another thread to try to help out a couple of folks who were seeing NB try to launch their Rails 3.0 projects by calling script/server, which no longer exists. It's now correctly trying to call script/rails, but somehow failing to find it.
When viewing the gems in the platform I've got the project set to, I do see all the appropriate gems including Rails 3.0.0. I also tried using Ruby 1.9.1 on the off chance that maybe NB didn't recognize 1.9.2 as 1.9, but that didn't make a difference.
I'm stumped. I have no idea what to try next. Does anyone else?
Thanks,
-Bill
Update: I've just realized that my issue is an exact duplicate of the one noted in this thread:
http://forums.netbeans.org/viewtopic.php?t=29812&start=0&postdays=0&postorder=asc |
|
| Back to top |
|
 |
springbok
Joined: 23 Aug 2010 Posts: 11
|
Posted: Wed Sep 01, 2010 10:43 pm Post subject: |
|
|
Hi bkocik,
I feel your pain, I have also now spent many hours trying to figure out what the problem is and how to solve it, so far no luck.
As you noted this is the same problem myself and others have experienced, hopefully someone involved in NB development will get us an answer soon.
Cheers,
Etienne. |
|
| Back to top |
|
 |
bkocik
Joined: 03 Oct 2008 Posts: 26
|
Posted: Thu Sep 02, 2010 10:27 am Post subject: |
|
|
Erno might be busy, but I expect he'll jump in here sooner or later and bail us out. He's always very helpful.
I actually had this working at one point early on, but then I decided I didn't like NetBeans having a different idea of my GEM_HOME than my command-line environment did because it meant that bundler on the command line wasn't synched with bundler in NB, so I went messing around with things. Ever since then I haven't been able to recreate those initial conditions under which it actually worked, and I don't know why.
| springbok wrote: | Hi bkocik,
I feel your pain, I have also now spent many hours trying to figure out what the problem is and how to solve it, so far no luck.
As you noted this is the same problem myself and others have experienced, hopefully someone involved in NB development will get us an answer soon.
Cheers,
Etienne. |
|
|
| Back to top |
|
 |
Erno Mononen Posted via mailing list.
|
Posted: Mon Sep 06, 2010 6:09 pm Post subject: At my wit's end (debugging a Rails 3.0/Ruby 1.9.2 app) |
|
|
Hi guys,
Sorry for the late reply, I've been away. It seems that the 1.9.2 /
Rails 3 / RVM / ruby-debug 0.4.9/10 combination is not working too well
(or at all) with NB. I will need to dig deeper to find out the root
cause. If you want to return the IDE to the initial state you can remove
the userdir (you can see where it is in Help | About) or run the IDE
using an alternate userdir: http://wiki.netbeans.org/FaqAlternateUserdir
(I'd recommend trying an alternate userdir first).
Unfortunately the situation at the moment is that I don't have much time
to work on NB Ruby, but I will try to get back to this when I have a
chance. In the meanwhile I will keep monitoring the list and try to help
and provide quick fixes when I can.
Thanks,
Erno
On 09/02/2010 12:28 PM, bkocik wrote:
| Quote: | Erno might be busy, but I expect he'll jump in here sooner or later and bail us out. He's always very helpful.
I actually had this working at one point early on, but then I decided I didn't like NetBeans having a different idea of my GEM_HOME than my command-line environment did because it meant that bundler on the command line wasn't synched with bundler in NB, so I went messing around with things. Ever since then I haven't been able to recreate those initial conditions under which it actually worked, and I don't know why.
springbok wrote:
| Quote: | Hi bkocik,
I feel your pain, I have also now spent many hours trying to figure out what the problem is and how to solve it, so far no luck.
As you noted this is the same problem myself and others have experienced, hopefully someone involved in NB development will get us an answer soon.
Cheers,
Etienne.
|
|
|
|
| Back to top |
|
 |
mattslay
Joined: 22 Jun 2010 Posts: 12
|
Posted: Mon Sep 06, 2010 8:47 pm Post subject: At my wit's end (debugging a Rails 3.0/Ruby 1.9.2 app) |
|
|
"...I don't have much time to work on NB Ruby..."
Not really something you want to hear from the folks who make the very IDE that I've chosen to go with for my Ruby/Rails development.
On Sep 6, 2010, at 8:35 AM, Erno Mononen <address-removed ([email]address-removed[/email])> wrote:
| Quote: | | I don't have much time to work on NB Ruby |
|
|
| Back to top |
|
 |
bkocik
Joined: 03 Oct 2008 Posts: 26
|
Posted: Tue Sep 07, 2010 1:06 pm Post subject: Re: At my wit's end (debugging a Rails 3.0/Ruby 1.9.2 app) |
|
|
Hi Erno...
| Erno Mononen wrote: |
Unfortunately the situation at the moment is that I don't have much time
to work on NB Ruby, but I will try to get back to this when I have a
chance. In the meanwhile I will keep monitoring the list and try to help
and provide quick fixes when I can. |
Thanks for the update. It's unfortunate that you're being taken away, but I hope it's because you're working on something fun and exciting.
For everyone else watching, there is a very practicable work-around to get you going that someone posted in another thread on this matter. In case you didn't get to see it, it's this:
| springbok wrote: | Ok I've finally been able to get debugging going manually for now at least, the steps I followed are:
| Quote: | 1. Uninstall all debug gems including:
ruby-debug19
ruby-debug-ide19
ruby-debug-base19
linecache19
I originally installed all these gems via my Gemfile & bundle install
2. I removed -J-DrubyDebugIDEName=ruby-debug-ide19 from my netneans.conf file which I had added an attempt to get it working
3. In NB Tools->Ruby Platforms I selected the version I wanted to use, i.e. 1.9.2 and installed the fast debugger via the "Install Fast Debugger" button. This will install v0.4.9 of ruby-debug-ide. You need to make sure your directories are correct as I found that NB does not detect the correct directories when using RVM. My directories are:
Interpreter: /home/etienne/.rvm/rubies/default/bin/ruby (I think because 1.9.2 is my default rvm ruby)
Gem Path:
/home/etienne/.rvm/gems/ruby-1.9.2-p0
/home/etienne/.rvm/gems/ruby-1.9.2-p0@global
4. Once the debugger is successfully installed in a terminal session run something like this to start the debugger manually:
rdebug-ide _0.4.9_ -p 7000 -- /var/www/rails/jobbeat/script/rails server mongrel --port 3010
5. Attach the NB debugger via Debug->Attach Debugger
|
Doing this allowed me to debug my project at least until all this is fixed.
My debug gems are now:
| Quote: | ruby-debug-base19 (0.11.24)
ruby-debug-ide (0.4.9)
linecache19 (0.5.11) |
Hope this helps,
Etienne. |
|
|
| Back to top |
|
 |
Paul Posted via mailing list.
|
Posted: Wed Sep 08, 2010 3:47 am Post subject: At my wit's end (debugging a Rails 3.0/Ruby 1.9.2 app) |
|
|
Say it ain't so, Errno!
I've appreciated your quick answers and fixes in the past, and I look
forward to you being back in the saddle soon.
I do want to say that the bug described below is kind of important at
the moment, now that Rails 3 is officially released, and RVM / Ruby
1.9.2 / Rails 3 seems to be the recommended setup. I'm running that
setup on the server, but I'm running 1.8.7 on my development machine
at the moment, hoping to slide by without anything unexpected
happening while waiting for your fix.
On Mon, Sep 6, 2010 at 9:35 AM, Erno Mononen <address-removed> wrote:
| Quote: |
Hi guys,
Sorry for the late reply, I've been away. It seems that the 1.9.2 / Rails 3
/ RVM / ruby-debug 0.4.9/10 combination is not working too well (or at all)
with NB. I will need to dig deeper to find out the root cause. If you want
to return the IDE to the initial state you can remove the userdir (you can
see where it is in Help | About) or run the IDE using an alternate userdir:
http://wiki.netbeans.org/FaqAlternateUserdir (I'd recommend trying an
alternate userdir first).
Unfortunately the situation at the moment is that I don't have much time to
work on NB Ruby, but I will try to get back to this when I have a chance. In
the meanwhile I will keep monitoring the list and try to help and provide
quick fixes when I can.
Thanks,
Erno |
|
|
| Back to top |
|
 |
nicolas
Joined: 08 Sep 2010 Posts: 1
|
Posted: Wed Sep 08, 2010 10:23 am Post subject: finally on windows |
|
|
Hi all,
I did as Etienne said above + worked around the "no such file to load -- script\rails" by editing directly the ruby-debug-ide.rb file, aroud line 123
( d:/Ruby19/lib/ruby/gems/1.9.1/gems/ruby-debug-ide19-0.4.12/lib/ruby-debug-ide.rb:125:in `debug_load' )
sr = "d:/fourth/script/rails" # d:/fourth is my project's root, obviously
bt = debug_load(sr, options.stop, options.load_mode)
# and comment following line:
# bt = debug_load(Debugger::PROG_SCRIPT, options.stop, options.load_mode)
Then debugging is all of sudden peaceful again.
Nicolas. |
|
| Back to top |
|
 |
baldmark
Joined: 10 Sep 2010 Posts: 6
|
Posted: Fri Sep 10, 2010 11:56 pm Post subject: (Hopefully) a slight enhancement |
|
|
Based on what Nicholas did I think I have generalised it for multiple Ruby / Rails projects by replacing the line
bt = debug_load(Debugger::PROG_SCRIPT, options.stop, options.load_mode)
around line 125 of ruby-debug-ide.rb with
if Debugger::PROG_SCRIPT == 'script/rails'
ps = `pwd`.chomp+'/script/rails'
else
ps = Debugger::PROG_SCRIPT
end
bt = debug_load(ps, options.stop, options.load_mode)
I don't have the confidence to attempt a 'proper' solution but (in my limited experience - I am a newbie) I can't see what this doesn't work for.
Mark |
|
| Back to top |
|
 |
corck
Joined: 15 Sep 2010 Posts: 8
|
Posted: Wed Sep 15, 2010 12:09 pm Post subject: breakpoint won't work |
|
|
I've done what @baldmark did and the server is starting now, but Netbeans won't stop at the breakpoints.
does it work for you guys, not much use otherwise.
update: I now followed the steps from Etienne as well and tried running the debugger from commandline and attaching Nebeans to it, still no luck
thanks |
|
| Back to top |
|
 |
baldmark
Joined: 10 Sep 2010 Posts: 6
|
|
| Back to top |
|
 |
corck
Joined: 15 Sep 2010 Posts: 8
|
Posted: Thu Sep 16, 2010 11:20 am Post subject: latest nightly works |
|
|
Hi,
just want to give an update. I downloaded the latest nightly, and I can use the debugger now.
Christoph |
|
| Back to top |
|
 |
dzajic
Joined: 31 Aug 2010 Posts: 1
|
Posted: Thu Sep 16, 2010 6:17 pm Post subject: Re: latest nightly works |
|
|
| corck wrote: | Hi,
just want to give an update. I downloaded the latest nightly, and I can use the debugger now.
Christoph |
Where do I download the latest nightly build? I really want to get Rails 3 debugging working |
|
| Back to top |
|
 |
corck
Joined: 15 Sep 2010 Posts: 8
|
|
| Back to top |
|
 |
djlewis
Joined: 01 Sep 2010 Posts: 5
|
Posted: Thu Sep 30, 2010 3:44 am Post subject: Re: latest nightly works |
|
|
| corck wrote: | Hi,
just want to give an update. I downloaded the latest nightly, and I can use the debugger now.
Christoph |
Not me. Downloaded on 9/29 (NetBeans IDE Build 201009291311) and I still see the problem where breakpoints in one file actually display at the correct line but in a different source file (and a different file for each breakpoint)
Also, there are still problems with "find usages" and "refactor" -- they often pick up an enclosing block instead of the highlighted symbol. |
|
| Back to top |
|
 |
|