在运行 Ruby 1.9.2 的 Snow Leopard 上安装 ruby​​-debug-ide

在运行 Ruby 1.9.2 的 Snow Leopard 上安装 ruby​​-debug-ide

我正在尝试在运行 Ruby 1.9 的 Snow Leopard 上安装 ruby​​-debug-ide,以便可以在 Netbeans 中调试 ruby​​ 代码。

我正在使用以下命令

sudo gem install ruby-debug-ide19

但是我一直收到以下错误:

nathan:mark-moseley-ruby-debug-ide-9eb626b nathan$ sudo gem install ruby-debug-ide19

构建本机扩展。这可能需要一段时间...错误:安装 ruby​​-debug-ide19 时出错:错误:无法构建 gem 本机扩展。

/Users/nathan/.rvm/rubies/ruby-1.9.2-head/bin/ruby extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
 --with-opt-dir
 --without-opt-dir
 --with-opt-include
 --without-opt-include=${opt-dir}/include
 --with-opt-lib
 --without-opt-lib=${opt-dir}/lib
 --with-make-prog
 --without-make-prog
 --srcdir=.
 --curdir
 --ruby=/Users/nathan/.rvm/rubies/ruby-1.9.2-head/bin/ruby
 --with-ruby-dir
 --without-ruby-dir
 --with-ruby-include
 --without-ruby-include=${ruby-dir}/include
 --with-ruby-lib
 --without-ruby-lib=${ruby-dir}/lib
/Users/nathan/.rvm/rubies/ruby-1.9.2-head/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:268:in `block (2 levels) in read': Looking for http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p160.tar.gz and all I got was a 404! (URI::NotFoundError)
 from /Users/nathan/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/net/http.rb:1194:in `block in transport_request'
 from /Users/nathan/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/net/http.rb:2342:in `reading_body'
 from /Users/nathan/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/net/http.rb:1193:in `transport_request'
 from /Users/nathan/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/net/http.rb:1177:in `request'
 from /Users/nathan/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/net/http.rb:1170:in `block in request'
 from /Users/nathan/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/net/http.rb:627:in `start'
 from /Users/nathan/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/net/http.rb:1168:in `request'
 from /Users/nathan/.rvm/rubies/ruby-1.9.2-head/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:239:in `block in read'
 from /Users/nathan/.rvm/rubies/ruby-1.9.2-head/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:286:in `connect'
 from /Users/nathan/.rvm/rubies/ruby-1.9.2-head/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:234:in `read'
 from /Users/nathan/.rvm/rubies/ruby-1.9.2-head/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:128:in `download'
 from /Users/nathan/.rvm/rubies/ruby-1.9.2-head/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.4/lib/ruby_core_source.rb:55:in `block in create_makefile_with_core'
 from /Users/nathan/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/tempfile.rb:320:in `open'
 from /Users/nathan/.rvm/rubies/ruby-1.9.2-head/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.4/lib/ruby_core_source.rb:51:in `create_makefile_with_core'
 from extconf.rb:20:in `<main>'
Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p160.tar.gz


Gem files will remain installed in /Users/nathan/.rvm/gems/ruby-1.9.2-head/gems/linecache19-0.5.11 for inspection.
Results logged to /Users/nathan/.rvm/gems/ruby-1.9.2-head/gems/linecache19-0.5.11/ext/trace_nums/gem_make.out

有人知道我该如何安装它吗?

注意我安装了最新的 xcode,但我使用 RVM 安装了 Ruby 1.9,我也用它将其设置为默认的 ruby​​ 环境。

答案1

我自己通过使用 homebrew 安装 Ruby(brew install ruby​​)解决了这个问题。看来 RVM 安装的版本存在一些问题(我在使用各种 gem 时都遇到了同样的问题)。

在使用 homebrew 安装 Ruby 后,我必须手动修改符号链接,因为默认情况下您的系统仍将使用 xcode 附带的 Ruby 1.8。

相关内容