sto*_*age 18 ruby rubygems ruby-on-rails
我在其他SO问题中看到了非常类似的问题(例如,ruby-1.9.2-p321没有提供debugger-ruby_core_source gem的来源)以及Google搜索,但到目前为止这些都没有帮助.
我正在使用OSX Mavericks(第一次使用mac用户)和rbenv(第一次使用它).我已经克隆了一个Rails项目,我以前在另一台笔记本电脑(Ubuntu和rvm)上运行.
rbenv version:2.0.0-p451(我手动安装)
当我尝试时bundle install,我得到以下内容:
...
Using debugger-ruby_core_source (1.3.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/macuser/.rbenv/versions/2.0.0-p451/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-2.0.0-p451 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
--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=/Users/macuser/.rbenv/versions/2.0.0-p451/bin/ruby
--with-ruby-dir
--without-ruby-dir
--with-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/
Gem files will remain installed in /Users/macuser/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/debugger-1.6.5 for inspection.
Results logged to /Users/macuser/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/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.
Run Code Online (Sandbox Code Playgroud)
所以我接着尝试运行gem install debugger -v '1.6.5',它基本上抛出了与上面相同的错误.
从搜索周围,这里有一些我尝试不成功的事情:
也许还有其他一些......但似乎没有任何效果.
更新:将我的rbenv本地环境切换到ruby 2.1.0并且它工作正常.没有解决潜在的问题,但我认为这很好
Dam*_*ien 22
尝试安装debugger而不指定版本,然后bundle install再次运行.
我有同样的错误,它只是工作,不要问我为什么:
$ gem install debugger
$ bundle install
Run Code Online (Sandbox Code Playgroud)
tor*_*man 16
在尝试使用ruby 2.0.0-p598安装dubugger时遇到了我认为同样的问题.
宝石调试器ruby_core_source是依赖调试,并提供头文件,似乎在安装使用红宝石的特定版本的调试器.查看debugger-ruby_core_source/lib/debugger/ruby_core_source/支持哪些版本 - 不为所有ruby版本提供头文件.就我而言,它们不是为2.0.0-p598版本提供的.
查看readger for debugger-ruby_core_source,有一个rake任务,用于为ruby版本添加所需的文件.
从gem的目录中的命令行,我跑了
$ rake add_source VERSION=2.0.0-p598
Run Code Online (Sandbox Code Playgroud)
当我第一次运行此任务时,我收到一个错误,并且需要在再次运行rake任务之前安装archive-tar-minitar gem.
rake任务为我的版本添加了头文件后,我能够成功安装并运行调试器.
我在这里发帖因为绝对没有用.解决这个问题的唯一解决方案:
即使我们正在安装调试器,但错误在于安装需求,debugger-ruby_core_source.
如果你看一下它引起问题的错误.
No source for ruby-2.0.0-p451 provided with debugger-ruby_core_source gem.
Run Code Online (Sandbox Code Playgroud)
实际上很容易修复这个错误.只需运行以下命令,安装依赖项,然后重试:
gem install debugger-ruby_core_source
Run Code Online (Sandbox Code Playgroud)
相信这个解决方案:FIXED gem install debugger -v'1.6.2'没有红宝石的来源
问题是你Gemfile.lock列出了一个旧debugger-ruby_core_source宝石.该gem需要知道您的特定ruby版本,以正确获取头文件,如果您的bundle安装的版本太旧,它将无法正常工作.
正确的解决方案是Gemfile.lock通过运行来更新您的新版本
bundle update debugger-ruby_core_source
Run Code Online (Sandbox Code Playgroud)
@ delba和@ superuseroi的答案基本上归结为使用直接从源gem安装debugger-ruby_core_sourcegem - 这将提取最新版本,但修复你的包将更容易,并将持续在你的源代码控制中(至少在你下次升级你的红宝石).
另请参阅有关常见Ruby gem问题的文章