LoginSignup
9
8

More than 5 years have passed since last update.

bundle installでdebugger-ruby_core_sourceが入らなかった話

Posted at

お仕事関係で他の人が担当してるプロジェクトのお手伝いに入ることになった。
内容はlocomotivecmsを使った開発です。
すでに開発自体進んでるものなので、とりあえず手元の環境を整えようとしたらハマりました。

bundle install --path=vendor/bundle
...
Using debugger-linecache 1.2.0
Using debugger-ruby_core_source 1.3.2

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/btm/.rbenv/versions/2.0.0-p481/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-p481 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/btm/.rbenv/versions/2.0.0-p481/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/btm/develop/test/vendor/bundle/ruby/2.0.0/gems/debugger-1.6.6 for inspection.
Results logged to /Users/btm/develop/test/vendor/bundle/ruby/2.0.0/gems/debugger-1.6.6/ext/ruby_debug/gem_make.out
An error occurred while installing debugger (1.6.6), and Bundler cannot continue.
Make sure that `gem install debugger -v '1.6.6'` succeeds before bundling.

プロジェクト自体のGemfile.lockがdebugger-ruby_core_sourceの1.3.2を指定していて、このバージョンを入れようとしてコケてるという感じです。

原因

平たく言えばdebugger-ruby_core_sourceが対応してるRubyのバージョンではなかったというオチです。
今回は2.0.0を利用するプロジェクトなんですが、このために現時点でruby-buildで入る最新のruby-2.0.0-p481を使ったのですが、これがdebugger-ruby_core_sourceでは1.3.4以降に対応しているようです。
なお、確認方法はdebugger-ruby_core_sourceのコミットログを見ました。

解決方法

今回は他の開発者がアップデートするの面倒だろうと思い、debugger-ruby_core_source 1.3.2で対応しているruby-2.0.0-p451を入れることで対応しました。

rbenv install 2.0.0-p451 --keep
rbenv local 2.0.0-p451
gem install bundler
bundle install --path=vendor/bundle

よくわからないこと

gem install debugger -v '1.6.6'

とか

gem install debugger-ruby_core_source -v '1.3.2'

とかはやっていたんだけど、これでもコケた。
他だとだいたいこのパターンで解決してるっぽいのだけど、なんだろう?
まぁ、このパターンなんか負けた気がするからいいんだけどw

9
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
8