【问题标题】:Error installing debugger-linecache in Ruby 1.9.3在 Ruby 1.9.3 中安装 debugger-linecache 时出错
【发布时间】:2012-06-06 14:55:35
【问题描述】:

我的项目需要 debugger-linecache 的 1.0.1 版,尝试安装时遇到以下错误。

trunk ☺  gem install debugger-linecache -v '1.0.1'
Building native extensions.  This could take a while...
ERROR:  Error installing debugger-linecache:
    ERROR: Failed to build gem native extension.

        /Users/jordanscales/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
Makefile creation failed
**************************************************************************
No source for ruby-1.9.3-p194 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.

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=/Users/jordanscales/.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


Gem files will remain installed in /Users/jordanscales/.rvm/gems/ruby-1.9.3-p194/gems/debugger-linecache-1.0.1 for inspection.
Results logged to /Users/jordanscales/.rvm/gems/ruby-1.9.3-p194/gems/debugger-linecache-1.0.1/ext/trace_nums/gem_make.out
trunk ☺  

任何帮助将不胜感激,我一直在寻找但找不到有效的解决方案。

【问题讨论】:

  • @SamyDindane trunk ☺ gem install ruby-debug-base19 --version=0.11.23 ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /Users/jordanscales/.rvm/gems/ruby-1.9.3-p194/gems/linecache19-0.5.12/AUTHORS
  • 您显然没有权限。以 root 身份尝试?

标签: ruby rubygems gem ruby-1.9.3


【解决方案1】:

这可能对你有帮助,它对我有用

gem install debugger-linecache -v '1.1.2' -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p286/

【讨论】:

  • 这为我解决了。刚刚用 p374 替换了 p286,这是我目前的补丁级别,我很高兴。
  • 谢谢;你是救生员。这似乎是……某事中的一个错误。可能是 rvm。
  • 如果您没有 ruby​​ 版本的源代码(二进制下载),那么您可以使用 rvm fetch <ruby>
【解决方案2】:

此错误表示debugger 的选定版本不支持您当前的Ruby 版本。有两种解决方案:

  1. 通过bundle update debugger 更新debugger gem。 debugger 的新版本向后兼容旧 Ruby 版本,因此这是修复它的最佳方法。
  2. 降级您的 Ruby 版本。

【讨论】:

  • 如果不奇怪,我会拥抱你。
  • 非常感谢!这也为我解决了问题。
  • 即使在今天也是最合适的解决方案!
  • 如果您使用的是 rbenv 而不是 RVM,这是一个很好的解决方案。谢谢。
【解决方案3】:

更新/安装gem debugger-ruby_core_source,

gem install debugger-ruby_core_source

这里已更正:https://github.com/cldwalker/debugger-ruby_core_source/pull/7

【讨论】:

  • 这是解决这个问题的最佳和最优雅的解决方案。
【解决方案4】:

问题是我错误地使用了 gemsets。我知道没有权限是个问题,因为在 RVM 下我不需要 sudo 来安装任何东西。

rvm gemset use global 然后bundle install 成功了。

【讨论】:

  • 也许您应该使用“ruby_project/.ruby-gemset”文件来避免您的 gemset 出现问题。
【解决方案5】:

来自以下链接:

https://github.com/cldwalker/debugger/issues/50

我已经安装了 gem ruby-debug19 并为我解决了如下问题:

$ bundle
... -> failed to build debugger-linecache
$ gem install ruby-debug19
$ bundle
... -> all is fine

【讨论】:

    【解决方案6】:

    在我的情况下,问题与debugger-linecache 没有直接关系。尝试升级 debugger-ruby_core_source 或将 Ruby 降级几个补丁级别。

    我已经执行了bundle update debugger-linecache。虽然我在 Gemfile.lock 中有它的最新版本,但 debugger-ruby_core_source 已经升级到 1.1.5 并且 debugger-linecache 已经停止抱怨了。

    【讨论】:

      【解决方案7】:

      我安装了 debugger-ruby_core_source gem,基于在这里阅读旧答案:https://github.com/cldwalker/debugger/issues/12

      【讨论】:

        【解决方案8】:

        如果您使用的是 rvm,请确保路径指向 ruby​​,在 rvm 的 rubies 文件夹中

        $rvm_path/rubies/ruby-1.9.3-p448

        gem install debugger-linecache -v '1.1.2' -- --with-ruby-include=$rvm_path/rubies/ruby-1.9.3-p448

        【讨论】:

          【解决方案9】:

          您的 Gemfile.lock 与您尝试捆绑的 Ruby 不同。

          bundle update 应该通过让 Bundler 查看不同的版本来工作。

          【讨论】:

            【解决方案10】:

            手动构建它。这个对我有用 https://gist.github.com/4060260

            【讨论】:

              猜你喜欢
              • 2012-07-06
              • 2012-10-17
              • 1970-01-01
              • 1970-01-01
              • 2016-03-15
              • 1970-01-01
              • 2012-02-24
              • 2012-07-23
              • 1970-01-01
              相关资源
              最近更新 更多