新手问题 大神帮忙看下 debug 的问题

gefangshuai · 2013年08月16日 · 最后由 gefangshuai 回复于 2013年08月16日 · 2109 次阅读

已经安装了 debug19,启动项目的时候却报错 rails -s --debugger 报如下错误 gefangshuai@gefangshuai-K43SV:~/myruby/rails1/blog$ rails server --debugger /home/gefangshuai/.rvm/gems/ruby-1.9.3-p448@rails4/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:1:in require': /home/gefangshuai/.rvm/gems/ruby-1.9.3-p448@rails4/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so: undefined symbol: ruby_current_thread - /home/gefangshuai/.rvm/gems/ruby-1.9.3-p448@rails4/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so (LoadError) from /home/gefangshuai/.rvm/gems/ruby-1.9.3-p448@rails4/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:1:in' from /home/gefangshuai/.rvm/gems/ruby-1.9.3-p448@rails4/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:5:in require' from /home/gefangshuai/.rvm/gems/ruby-1.9.3-p448@rails4/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:5:in' from /home/gefangshuai/.rvm/gems/ruby-1.9.3-p448@rails4/gems/bundler-1.4.0.pre.1/lib/bundler/runtime.rb:75:in require' from /home/gefangshuai/.rvm/gems/ruby-1.9.3-p448@rails4/gems/bundler-1.4.0.pre.1/lib/bundler/runtime.rb:75:inblock (2 levels) in require' from /home/gefangshuai/.rvm/gems/ruby-1.9.3-p448@rails4/gems/bundler-1.4.0.pre.1/lib/bundler/runtime.rb:71:in each' from /home/gefangshuai/.rvm/gems/ruby-1.9.3-p448@rails4/gems/bundler-1.4.0.pre.1/lib/bundler/runtime.rb:71:inblock in require' from /home/gefangshuai/.rvm/gems/ruby-1.9.3-p448@rails4/gems/bundler-1.4.0.pre.1/lib/bundler/runtime.rb:60:in each' from /home/gefangshuai/.rvm/gems/ruby-1.9.3-p448@rails4/gems/bundler-1.4.0.pre.1/lib/bundler/runtime.rb:60:inrequire' from /home/gefangshuai/.rvm/gems/ruby-1.9.3-p448@rails4/gems/bundler-1.4.0.pre.1/lib/bundler.rb:130:in require' from /home/gefangshuai/myruby/rails1/blog/config/application.rb:7:in' from /home/gefangshuai/.rvm/gems/ruby-1.9.3-p448@rails4/gems/railties-4.0.0/lib/rails/commands.rb:76:in require' from /home/gefangshuai/.rvm/gems/ruby-1.9.3-p448@rails4/gems/railties-4.0.0/lib/rails/commands.rb:76:inblock in ' from /home/gefangshuai/.rvm/gems/ruby-1.9.3-p448@rails4/gems/railties-4.0.0/lib/rails/commands.rb:73:in tap' from /home/gefangshuai/.rvm/gems/ruby-1.9.3-p448@rails4/gems/railties-4.0.0/lib/rails/commands.rb:73:in' from bin/rails:4:in require' from bin/rails:4:in

'

还少了什么 gem 吗?

ruby-debug19 已经不维护了,换 debugger 试试。具体参考http://stackoverflow.com/questions/1083451/debugging-in-ruby-1-9 发帖代码格式最好能注意下,这个看着比较费劲。

用 Pry 吧

果断用 pry 啊

需要 登录 后方可回复, 如果你还没有账号请 注册新账号