ruby-on-rails - gem install debugger -v '1.5.0' 失败

标签 ruby-on-rails ruby macos bundler rbenv

我正在尝试在 Mavericks 上的大型项目中执行 bundle,尽管这是 rbenv 的全新安装,但一些 gems 已损坏或我的环境出现问题。

$ gem install debugger -v '1.5.0'
Building native extensions.  This could take a while...
ERROR:  Error installing debugger:
    ERROR: Failed to build gem native extension.

        /Users/samat/.rbenv/versions/1.9.3-p448/bin/ruby extconf.rb
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
Makefile creation failed
**************************************************************************
No source for ruby-1.9.3-p448 provided with debugger-ruby_core_source gem.
**************************************************************************
*** 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.
    ...

不知道我需要什么配置选项

在 mkmf 中我看到类似的东西

"gcc -I/Users/samat/.rbenv/versions/1.9.3-p448/include/ruby-1.9.1/x86_64-darwin13.0.0 -I/Users/samat/.rbenv/versions/1.9.3-p448/include/ruby-1.9.1/ruby/backward -I/Users/samat/.rbenv/versions/1.9.3-p448/include/ruby-1.9.1 -I. -I/Users/samat/.rbenv/versions/1.9.3-p448/include/ruby-1.9.1/ruby-1.9.3-p448 -I'/Users/samat/.rbenv/versions/1.9.3-p448/include'  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -I'/Users/samat/.rbenv/versions/1.9.3-p448/include'   -O3 -Wno-error=shorten-64-to-32  -pipe   -c conftest.c"
conftest.c:3:10: fatal error: 'method.h' file not found
#include <method.h>
         ^
1 error generated.
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <method.h>
    ...

我用的是 rbenv,

$ rbenv version
1.9.3-p448 (set by /Users/samat/Documents/bm-git/.ruby-version)

最佳答案

来自debugger page它说如果找不到 ruby​​ 源,它将尝试安装 debugger-ruby_core_source,这实际上对我来说是失败的。我使用 rbenv,所以我根据调试器 gem 说明,将其指向 rbenv 源。

gem 安装调试器 -- --with-ruby-include=~/.rbenv/versions/1.9.3-p484/include

关于ruby-on-rails - gem install debugger -v '1.5.0' 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19656659/

相关文章:

swift - NSView keyDown/keyUp 忽略 Swift 中的特定键。如何让它监听所有按键?

ruby-on-rails - rails : controller won't update model correctly

javascript - 在 session 中传递所选国家/地区(下拉列表)的值,然后重新加载当前页面(Rails 4)

ruby-on-rails - Rails/Haml 错误 : undefined method `-@' for "":String

linux - 在哪里可以找到 cksum 的 Linux 实现,它可以完成 OSX cksum -o3 的功能?

macos - 有没有办法获取Docker守护程序REST API调用?

ruby-on-rails - 如何将 css/sass 样式表关联到 Rails 中的 View ?

mysql - rails 2.3 : Replace record associations instead of delete

ruby - 在 ruby​​ 中增加二进制有效载荷

ruby - Paypal 沙盒不发送 Webhook 或 IPN 通知