27

新しいプロジェクトのバンドルを実行しようとすると、次のエラーが発生します。

Installing debugger (1.2.2) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    C:/Ruby193/bin/ruby.exe 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-1.9.3-p362 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=C:/Ruby193/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 C:/Ruby193/lib/ruby/gems/1.9.1/gems/debugger-1.2.2 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/debugger-1.2.2/ext/ruby_debug/gem_make.out
An error occured while installing debugger (1.2.2), and Bundler cannot continue.
Make sure that `gem install debugger -v '1.2.2'` succeeds before bundling.

実行gem install debugger -v '1.2.2'しても同じ結果が得られます。

mkmf.log と gem_make.out ファイルの内容を確認しましたが、ほとんど意味がありませんが、要求があれば投稿します。

なぜこれが機能しないのですか?

4

8 に答える 8

42

私は同じ問題に遭遇しました。私は試した:

bundle update debugger

私のGemfileにはこれがありました:

gem 'debugger'

Gemfile を変更する必要はありませんでした。バンドルの出力は次のようになります

...

Installing debugger-ruby_core_source (1.1.6)

Installing debugger-linecache (1.1.2) with native extensions

Installing debugger (1.1.4) with native extensions

...

于 2012-12-31T13:10:55.767 に答える
16

この問題の解決策は、単純に debugger-ruby_core_source gem ( github の eiel による debugger-ruby_core_source のフォーク バージョン)をインストールすることでした。

(私の側で)多くの試行錯誤の後、私は単純に

gem install debugger-ruby_core_source -v '1.1.6'

p362 ヘッダーの組み込みを強制します。それから私が実行したときbundle、デバッガーはネイティブ拡張機能で正常にビルドされ、バンドラーは陽気な方法で続行され、私もそうでした.

ほんの数回使用しましたが、実際に簡単解決策にたどり着く前に、いくつかのことを試し、これを機能させるために数時間を費やしました。

于 2012-12-27T19:56:30.783 に答える
10

バンドルアップデートを使用したほうがいいかもしれませんが、ここでは問題なく機能しました。

$バンドル更新デバッガー-ruby_core_source

すべてのデバッガーgemに更新を使用することを検討してください。

$バンドル更新デバッガー

于 2012-12-28T05:30:00.753 に答える
6

どうやらデバッガーは ruby​​ 2.* ではサポートされていないため、代わりに byebug を使用してください。 http://edgeguides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-byebug-gem

于 2014-12-12T19:13:41.413 に答える
4

RVM経由でインストールされたRuby 2.0.0でこれに遭遇しました。他の解決策はどれもうまくいきませんでした。

RVM はバイナリが利用可能であればインストールするだけで、より高速ですが、デバッガにはソースも必要です

rvm reinstall 2.0.0 --disable-binary
于 2014-10-27T18:41:42.347 に答える
0

それは私のために働いた:

$ rvm use 2.0

またはデフォルトにするには:

$ rvm use --default 2.0
于 2014-08-28T09:06:25.893 に答える