gpt4 book ai didi

ruby - 无法在 Mac OS X 10.7.3 Lion 上的 ruby​​ 1.8.7 中加载 ruby​​-debug

转载 作者:数据小太阳 更新时间:2023-10-29 07:57:11 25 4
gpt4 key购买 nike

无法在 Mac OS X 10.7.3 Lion 上加载 ruby​​-debug。

不知道为什么路径不正确。

Ruby 版本是 1.8.7,这是 Lion 的标准版本。

已安装 Xcode

Developer Information:

Version: No version information available
Location: /Applications/Xcode.app
Applications:
Xcode: 4.3 (1175)
Instruments: 4.3 (4321)
SDKs:
Mac OS X:
10.6: (10K549)
10.7: (11D50a)
iPhone OS:
5.0: (9A334)
iPhone Simulator:
5.0: (9A334)


$ sudo gem install ruby-debug -v 0.10.4
Password:
Building native extensions. This could take a while...
ERROR: Error installing ruby-debug:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/linecache-0.46 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/linecache-0.46/ext/gem_make.out


$

在Lion系统上查找ruby.h路径,路径不一样。

./Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Ruby.framework/Versions/1.8/Headers/ruby.h
./Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0/ruby.h
./Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Ruby.framework/Versions/1.8/Headers/ruby.h
./Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0/ruby.h

此时最好的方法是什么?

谢谢,

最佳答案

解决方案:需要安装 Xcode 4.3,然后必须从 Xcode Preferences-General 安装 Xcode Command Line Tools。

如果没有命令行工具,则会生成上述错误。

安装后,Ruby-Debug 会加载。

$ sudo gem install ruby-debug -v 0.10.4
Password:
Building native extensions. This could take a while...
Building native extensions. This could take a while...
Successfully installed linecache-0.46
Successfully installed ruby-debug-base-0.10.4
Successfully installed ruby-debug-0.10.4
3 gems installed
Installing ri documentation for linecache-0.46...
Installing ri documentation for ruby-debug-base-0.10.4...
Installing ri documentation for ruby-debug-0.10.4...
Installing RDoc documentation for linecache-0.46...
Installing RDoc documentation for ruby-debug-base-0.10.4...
Installing RDoc documentation for ruby-debug-0.10.4...
$ rdebug -v
ruby-debug 0.10.4

关于ruby - 无法在 Mac OS X 10.7.3 Lion 上的 ruby​​ 1.8.7 中加载 ruby​​-debug,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9471691/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com