ruby-on-rails - 无法安装 gem debugger -v '1.6.5'

标签 ruby-on-rails ruby ruby-on-rails-3 rubygems

Mac OSX 10.9.1、ruby 1.9.3p194、rails 3.2.13、XCode 5.0.2

尝试执行“捆绑安装”,但在调试器 1.6.5 中不断出现错误(运行 gem install debugger -v '1.6.5' 会产生相同的错误)。任何帮助是极大的赞赏!

Installing debugger (1.6.5) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for rb_method_entry_t.called_id in method.h... *** 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
  --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-1.9.3-p194/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
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
  from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:491:in `block in try_compile'
  from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:443:in `with_werror'
  from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:491:in `try_compile'
  from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:1002:in `block in have_struct_member'
  from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
  from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
  from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open'
  from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
  from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open'
  from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
  from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
  from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:1001:in `have_struct_member'
  from extconf.rb:34:in `block in <main>'
  from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/debugger-ruby_core_source-1.3.1/lib/debugger/ruby_core_source.rb:21:in `call'
  from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/debugger-ruby_core_source-1.3.1/lib/debugger/ruby_core_source.rb:21:in `create_makefile_with_core'
  from extconf.rb:87:in `<main>'


Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p194/gems/debugger-1.6.5 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p194/gems/debugger-1.6.5/ext/ruby_debug/gem_make.out
An error occurred while installing debugger (1.6.5), and Bundler cannot continue.
Make sure that `gem install debugger -v '1.6.5'` succeeds before bundling.

最佳答案

这应该可以解决您的问题:

xcode-select --install

来源:https://stackoverflow.com/a/19570890/702560

关于ruby-on-rails - 无法安装 gem debugger -v '1.6.5',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21860491/

相关文章:

javascript - Angular ng-model 将数据作为数组发送到rails-api

ruby-on-rails - 如何在 Rails 中创建受密码保护的 RSS 提要

ruby - 更好的 ruby​​ - 可以不重复函数的某些部分吗?

ruby-on-rails - 迁移中default和null有什么区别

ruby-on-rails - 如何调试 Rails 中的 Trace/BPT Trap 错误?

ruby-on-rails - 如何获取通过事件管理员登录的当前用户?

ruby - 查找字符串中的常见模式并根据模式对它们进行分组

ruby-on-rails - Rails4 和 MongoMapper

ruby-on-rails - 在现有的 Ruby on Rails 应用程序中创建博客

ruby-on-rails - 如何使用涉及 Unicode 的 Assets 名称?