2010-11-21 59 views
7

我安装红宝石调试器,但即使在那之后,当我尝试启动Rails服务器“--debugger”选项,我得到一个控制台错误说,红宝石,调试器没有安装请参阅下面的日志: -Ruby调试器安装帮助!

:~/work_space/rails_apps/Bidding_sys_remaining$ sudo gem install ruby-debug <<<<<<< 

Building native extensions. This could take a while... 
Building native extensions. This could take a while... 
Successfully installed columnize-0.3.2 
Successfully installed linecache-0.43 
Successfully installed ruby-debug-base-0.10.4 
Successfully installed ruby-debug-0.10.4 
4 gems installed 
Installing ri documentation for columnize-0.3.2... 
Installing ri documentation for linecache-0.43... 
Installing ri documentation for ruby-debug-base-0.10.4... 
Installing ri documentation for ruby-debug-0.10.4... 
Installing RDoc documentation for columnize-0.3.2... 
Installing RDoc documentation for linecache-0.43... 
Installing RDoc documentation for ruby-debug-base-0.10.4... 
Installing RDoc documentation for ruby-debug-0.10.4... 

:~/work_space/rails_apps/Bidding_sys_remaining$ 
:~/work_space/rails_apps/Bidding_sys_remaining$ rails server --debugger 
=> Booting WEBrick 
=> Rails 3.0.1 application starting in development on http://0.0.0.0:3000 
=> Call with -d to detach 
=> Ctrl-C to shutdown server 
You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug' 

退出

这是我第一次尝试使用rails调试器。
还有任何建议的链接,以获得帮助开始使用rails调试器任何指南为新手?

回答

14

确保用户在使用的Gemfile

gem 'ruby-debug' # for ruby 1.8.7+  
gem 'ruby-debug19' # for ruby 1.9.2+ 

,然后将宝石运行bundle安装

更新:

你也可以将它添加到你的Gemfile,它会照顾这两个红宝石版本。

gem 'ruby-debug19', :require => 'ruby-debug', :platforms => :mri_19 
    gem 'ruby-debug', :platforms => :mri_18 
+0

哈,我以为我是SOL在ruby 1.9中进行调试。谢谢! – swilliams 2010-12-01 20:44:37

4

只是为了跳什么乔治说,因为Gemfile中支持的话,你可能想要把它在一组,因为你可能不希望在生产红宝石调试。

group :development do 
    gem 'ruby-debug19' # or ruby-debug for 1.8.7 
end