简体   繁体   中英

debugger won't install Rails 4.1.5

So I was trying to do a bundle update and I got:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

 /home/adam/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb 

* 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=/home/adam/.rvm/rubies/ruby-2.1.2/bin/ruby /home/adam/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/fileutils.rb:1573:in stat': No such file or directory @ rb_file_s_stat - ./212/ruby_debug.h (Errno::ENOENT) from /home/adam/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/fileutils.rb:1573:in block in fu_each_src_dest' from /home/adam/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/fileutils.rb:1587:in fu_each_src_dest0' from /home/adam/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/fileutils.rb:1571:in fu_each_src_dest' from /home/adam/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/fileutils.rb:399:in cp' from extconf.rb:83:in block in ' from extconf.rb:82:in each' from extconf.rb:82:in '

extconf failed, exit code 1

Gem files will remain installed in /home/adam/.rvm/gems/ruby-2.1.2/gems/debugger-1.6.8 for inspection. Results logged to /home/adam/.rvm/gems/ruby-2.1.2/extensions/x86_64-linux/2.1.0/debugger-1.6.8/gem_make.out An error occurred while installing debugger (1.6.8), and Bundler cannot continue. Make sure that gem install debugger -v '1.6.8' succeeds before bundling.

So I tried to do the following: gem install debugger -v '1.6.8' and got

Building native extensions. This could take a while... ERROR: Error installing debugger: ERROR: Failed to build gem native extension.

 /home/adam/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb 

* 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=/home/adam/.rvm/rubies/ruby-2.1.2/bin/ruby /home/adam/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/fileutils.rb:1573:in stat': No such file or directory @ rb_file_s_stat - ./212/ruby_debug.h (Errno::ENOENT) from /home/adam/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/fileutils.rb:1573:in block in fu_each_src_dest' from /home/adam/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/fileutils.rb:1587:in fu_each_src_dest0' from /home/adam/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/fileutils.rb:1571:in fu_each_src_dest' from /home/adam/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/fileutils.rb:399:in cp' from extconf.rb:83:in block in ' from extconf.rb:82:in each' from extconf.rb:82:in '

extconf failed, exit code 1

Gem files will remain installed in /home/adam/.rvm/gems/ruby-2.1.2/gems/debugger-1.6.8 for inspection. Results logged to /home/adam/.rvm/gems/ruby-2.1.2/extensions/x86_64-linux/2.1.0/debugger-1.6.8/gem_make.out

I have 4 other rails apps all running 4.1.5 and they all have no issue with bundle update so what's going on?

The debugger gem isn't supposed to be used with ruby 2.0+ , and literally won't install with ruby 2.1.2 . You are going to have to switch to byebug .

If you're a fan of pry there is also pry-byebug

Here is how my debugging gems in my Gemfile look like with Rails 4 and Ruby 2.1.2

group :development do
    gem 'pry'
    gem 'pry-remote'
    gem 'pry-rails'
    gem 'pry-stack_explorer'
    gem 'pry-byebug'
end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM