怎么用Ruby1.9.3调试?

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (2)
  • 关注 (0)
  • 查看 (19)

我刚更新到Ruby 1.9.3p0,Rails 3.1.1。现在,当我尝试启动服务器时,它说我应该安装ruby-debug,即使它已经安装。

% rails server --environment=development --debug
=> Booting WEBrick
=> Rails 3.1.0 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'
Exiting

在我的Gemfile中有

# see: http://stackoverflow.com/questions/1083451/debugging-in-ruby-1-9
gem 'ruby-debug-base19', "0.11.24"
gem 'ruby-debug19', "0.11.6"

是否可以使用最新版本的Ruby运行调试?

提问于
用户回答回答于

这是一个临时解决方案:http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug 首先从http://rubyforge.org/frs/?group_id=8883下载linecache19-0.5.13.gem和ruby-debug-base19-0.11.26.gem $ gem install linecache19-0.5.13.gem Building native extensions. This could take a while... Successfully installed linecache19-0.5.13 1 gem installed $ gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=/Users/santiago/.rbenv/source/ruby-1.9.3-p0 Building native extensions. This could take a while... Successfully installed ruby-debug-base19-0.11.26 1 gem installed $ irb irb(main):001:0> require 'ruby-debug' => true

用户回答回答于

linecache19和ruby-debug-base19的安装可以通过以下方式完成:

bash < <(curl -L https://raw.github.com/gist/1333785)

扫码关注云+社区