在Ruby 1.9.3中安装调试程序linecache时出错

在Ruby 1.9.3中安装调试程序linecache时出错,ruby,rubygems,gem,ruby-1.9.3,Ruby,Rubygems,Gem,Ruby 1.9.3,我需要一个项目的调试器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.

我需要一个项目的
调试器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 ☺  

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

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


rvm gemset使用全局
,然后安装一个
捆绑包

这可能会对您有所帮助,它适合我

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

此错误意味着所选版本的
调试器
不支持当前的Ruby版本。有两种解决方案:

  • 通过
    bundle Update debugger
    更新
    调试器
    gem。新版本的
    调试器
    与旧的Ruby版本向后兼容,因此这是修复它的最佳方法
  • 降低你的Ruby版本

  • 在我的例子中,问题与
    调试器linecache
    没有直接关系。请尝试升级
    debugger-ruby\u core\u source
    或将ruby降级几级


    我已经执行了
    捆绑更新调试器linecache
    。虽然我的最新版本是Gemfile.lock,
    debugger-ruby\u core\u source
    已升级到1.1.5,并且调试器linecache已停止抱怨。

    更新/安装
    gem debugger-ruby\u core\u source

    gem install debugger-ruby_core_source
    

    此处已更正:

    手动构建它。它对我有用

    我在这里仔细阅读了以前的答案后,安装了debugger-ruby\u core\u source gem:

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

    $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
    gem安装调试器linecache-v'1.1.2'--with ruby include=$rvm_path/rubies/ruby-1.9.3-p448您的Gemfile.lock不是用您试图绑定的同一个ruby编写的

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

    从以下链接:

    我已经安装了gemruby-debug19,并为我解决了以下问题:

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

    @SamyDindane
    trunk☺  gem安装ruby-debug-base19--版本=0.11.23错误:在执行gem时。。。(Errno::EPERM)不允许操作-/Users/jordanscales/.rvm/gems/ruby-1.9.3-p194/gems/linecache19-0.5.12/AUTHORS
    您显然没有权限。试试根?如果不奇怪的话,我会拥抱你的。非常感谢!这也解决了我的问题。即使在今天也是最合适的解决方案!如果您使用的是rbenv而不是RVM,这是一个很好的解决方案。谢谢,这帮我解决了。刚刚用p374替换了p286,这是我当前的补丁级别,我很乐意去做;你是救命恩人。这似乎是一个错误在。。。某物可能是rvm。如果您的ruby版本(二进制下载)没有源代码,那么您可以执行
    rvm fetch
    这是解决此问题的最佳和最优雅的解决方案。也许您应该使用“ruby_project/.ruby gemset”文件来避免gemset出现问题。