简体   繁体   English

netbeans 6.9.1 + rails 3 + ruby​​ 1.9.2p0调试

[英]netbeans 6.9.1 + rails 3 + ruby 1.9.2p0 debugging

I'm running OpenSuSE 11.3 and am having problems debugging rails3 application in NetBeans 6.9.1 (ruby 1.9.2p0, rails 3.0.3, rvm). 我正在运行OpenSuSE 11.3并且在NetBeans 6.9.1(ruby 1.9.2p0,rails 3.0.3,rvm)中调试rails3应用程序时遇到问题。

  1. I have installed ruby-debug19, ruby-debug-ide19 我安装了ruby-debug19,ruby-debug-ide19
  2. Changed Gemfile, so that the line 'gem ruby-debug19' is not commented out 更改了Gemfile,因此没有注释掉'gem ruby​​-debug19'这一行
  3. Ran 'bundle install' '捆绑安装'

When I ran 'ruby s --debugger' in console I got the following: 当我在控制台中运行'ruby s --debugger'时 我得到了以下内容:

tux@linux-hby6:~/prg/ruby/rail3-sqlite> rails s --debugger
=> Booting WEBrick
=> Rails 3.0.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
=> Debugger enabled
[2010-12-16 01:07:13] INFO  WEBrick 1.3.1
[2010-12-16 01:07:13] INFO  ruby 1.9.2 (2010-08-18) [i686-linux]
[2010-12-16 01:07:13] INFO  WEBrick::HTTPServer#start: pid=4105 port=3000

NetBeans: NetBeans的:

Fast Debugger (ruby-debug-ide 0.4.9) listens on :35528
        /home/tux/.rvm/gems/ruby-1.9.2-p0/gems/ruby-debug-ide19-0.4.12/lib/ruby-debug-ide.rb:123:in `debug_load'
        /home/tux/.rvm/gems/ruby-1.9.2-p0/gems/ruby-debug-ide19-0.4.12/lib/ruby-debug-ide.rb:123:in `debug_program'
        /home/tux/.rvm/gems/ruby-1.9.2-p0/gems/ruby-debug-ide19-0.4.12/bin/rdebug-ide:87:in `'
        /home/tux/.rvm/gems/ruby-1.9.2-p0/bin/rdebug-ide:19:in `load'
        /home/tux/.rvm/gems/ruby-1.9.2-p0/bin/rdebug-ide:19:in `'
Uncaught exception: no such file to load -- script/rails

Any ideas how can I solve it? 任何想法我该如何解决?

Thanks! 谢谢!

I have found the solution! 我找到了解决方案! This post gave me some hints. 这篇文章给了我一些提示。

my platform: ruby 1.9.2-p136, rails 3.0.3, netbeans 7.0 beta 我的平台:ruby 1.9.2-p136,rails 3.0.3,netbeans 7.0 beta

file: ruby-1.9.2-p136/gems/ruby-debug-ide19-0.4.12/bin/rdebug-ide:79 file:ruby-1.9.2-p136 / gems / ruby​​-debug-ide19-0.4.12 / bin / rdebug-ide:79

script = ARGV.shift
Debugger::PROG_SCRIPT = (script =~ /script([\\\/])rails/ ? Dir.pwd + $1 : '') + script
puts Debugger::PROG_SCRIPT
#Debugger::PROG_SCRIPT = ARGV.shift

Look at this thread at the netbeans's forums. 在netbeans的论坛上看一下这个帖子。 It worked for me: 它对我有用:

http://forums.netbeans.org/post-93244.html http://forums.netbeans.org/post-93244.html

The post: 帖子:

The problem is the missing path . in $:, so the scripts aren't found.
I inserted
$: << "."
before the load command in rdebug-ide (/usr/bin/rdebug-ide).
It fixed the problem.
(NetBeans 6.9.1, ruby 1.9.2p0 (2010-08-18) [x86_64-linux])
_________________
tiesel

its the answer 它的答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM