我在其他 SO 问题中看到了非常类似的问题(例如debugger-ruby_core_source gem 没有提供 ruby-1.9.2-p321 的源代码 https://stackoverflow.com/questions/20461846/no-source-for-ruby-1-9-2-p321-provided-with-debugger-ruby-core-source-gem)以及通过谷歌搜索,但到目前为止这些都没有帮助。
我正在使用 OSX Mavericks(第一次使用 mac 用户)和 rbenv(也是第一次使用)。我已经 git 克隆了一个 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.
所以我然后尝试跑步gem install debugger -v '1.6.5'
,这会引发与上面基本相同的错误。
通过搜索,以下是我尝试过但未成功的一些事情:
rake add_source http://sponsorpay.github.io/blog/2012/06/11/ruby-debugger-and-no-source-for-ruby-error/
bundle update debugger https://github.com/cldwalker/debugger/issues/63
重置 gemfile.lock https://stackoverflow.com/questions/20461846/no-source-for-ruby-1-9-2-p321-provided-with-debugger-ruby-core-source-gem
gem install debugger-ruby_core_source http://blog.houen.net/fix-gem-install-debugger/
可能还有其他一些......但似乎没有任何作用。
更新:将我的 rbenv 本地环境切换到 ruby 2.1.0 并且它有效。没有解决根本问题,但我想这很好
尝试安装debugger
不指定版本然后运行bundle install
again.
我遇到了同样的错误,并且它正常工作,不要问我为什么:
$ gem install debugger
$ bundle install
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)