【问题标题】:An error occurred while installing debugger (1.6.6)安装调试器时出错 (1.6.6)
【发布时间】:2014-05-19 03:44:42
【问题描述】:

当我运行 bundle install 时,在安装调试器 gem (1.6.6) 时出现错误。我正在使用 ruby​​ 2.1.1 和 rails 4.0.4。我对 Rails 比较陌生,不确定是什么导致了这个问题。

Gemfile

错误

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/usr/local/rvm/rubies/ruby-2.1.1/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
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
*************************************************************

NOTE: If your headers were not found, try passing
    --with-ruby-include=PATH_TO_HEADERS      

*************************************************************

*** 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=/usr/local/rvm/rubies/ruby-2.1.1/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

extconf failed, exit code 1

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.1.1/gems/debugger-1.6.6 for    inspection.
Results logged to /usr/local/rvm/gems/ruby-2.1.1/extensions/x86_64-darwin-12/2.1.0-   static/debugger-1.6.6/gem_make.out
An error occurred while installing debugger (1.6.6), and Bundler cannot continue.
Make sure that `gem install debugger -v '1.6.6'` succeeds before bundling.

【问题讨论】:

标签: ruby-on-rails ruby gem rvm


【解决方案1】:

编辑

Ruby 2.x.x 不完全支持

Debugger

Issue#118 是解决相同问题的热门问题。尽管它提到调试器 1.6.6 必须受 Ruby 2.1.1 支持,但用户仍然遇到与您类似的错误。

另外,他们的known issues 中特别提到了这一点。

您可以尝试关注that discussion 来解决您的问题。
此外,这可能会有所帮助:

rm Gemfile.lock
gem install debugger-ruby_core_source
gem update
bundle install

另一个问题的解决方案讨论了更新 Ruby 二进制文件的可能性。

如果没有任何效果,并且您可以更改 ruby​​/rails 版本,我可以建议我当前的组合:

ruby 2.0.0-p195
rails 4.0.0

它们与debugger gem 完美配合。

【讨论】:

  • 运行第一行代码成功安装了gem,但是运行gem install debugger还是报同样的错误
  • @EricFilkins 刚刚更新了上面的答案。这是一个主要版本冲突的问题。
  • 你几乎不应该这样做rm Gemfile.lock。这将更新所有宝石,而不仅仅是有问题的宝石。
【解决方案2】:

首先,你可以这样安装:gem install debugger -v '1.6.8',这次就可以了。而且,bundle install 不会被 debugger 的 gem 阻塞。 我不知道为什么它有效,但它确实对我有效, 顺便说一句,bundle 将安装 2 个版本的调试器 gem。 我的环境是 ruby​​ 1.9.3

【讨论】:

    【解决方案3】:

    删除您的 Gemfile.lock 文件

    $ rm Gemfile.lock
    然后继续:$bundle install

    它会解决问题, 这是我在设置 CyDoc 时遇到的

    【讨论】:

    • Gemfile.lock 跟踪所有 gem 依赖项,并有 gem 版本可供使用。如果删除此文件,可能会破坏所有 gem 依赖项。
    • @Furkan Ayhan > 你是对的,但是以前安装的一些包(版本)会对新包的安装造成问题。(尤其是 gem 依赖版本)你可以重新创建同样的错误:通过设置 CYDOC github.com/huerlisi/CyDoc
    • @FurkanAyhan > 你有什么意见?
    猜你喜欢
    • 2016-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-16
    • 2017-09-15
    • 2017-10-11
    • 2015-01-17
    • 2013-11-13
    相关资源
    最近更新 更多