Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't get past installing debugger

I'm trying to create a new Rails project and when I run rails new appname it tells me

Could not find debugger-1.6.8 in any of the sources
Run `bundle install` to install missing gems.

Then when I run bundle install I get this error

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

    /Users/username/.rvm/rubies/ruby-2.1.4/bin/ruby -r ./siteconf20141213-76431-12dyum4.rb 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=/Users/username/.rvm/rubies/ruby-2.1.4/bin/ruby
/Users/username/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/fileutils.rb:1401:in `initialize': No such file or directory @ rb_sysopen - ./214/ruby_debug.h (Errno::ENOENT)
  from /Users/username/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/fileutils.rb:1401:in `open'
  from /Users/username/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/fileutils.rb:1401:in `copy_file'
  from /Users/username/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/fileutils.rb:483:in `copy_file'
  from /Users/username/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/fileutils.rb:400:in `block in cp'
  from /Users/username/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/fileutils.rb:1579:in `block in fu_each_src_dest'
  from /Users/username/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/fileutils.rb:1593:in `fu_each_src_dest0'
  from /Users/username/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/fileutils.rb:1577:in `fu_each_src_dest'
  from /Users/username/.rvm/rubies/ruby-2.1.4/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 /Users/username/.rvm/gems/ruby-2.1.4/gems/debugger-1.6.8 for inspection.
Results logged to /Users/username/.rvm/gems/ruby-2.1.4/extensions/x86_64-darwin-13/2.1.0-static/debugger-1.6.8/gem_make.out 

I know that debugger doesn't work with Ruby 2.1.4, so how do i get bundler to stop trying to install it? Do i have to use a rails application template?

like image 596
drabnew Avatar asked Nov 01 '22 13:11

drabnew


1 Answers

So for this exact case -- comment out or remove it and any gems that depend on it (look at Gemfile.lock) from your Gemfile at the root of your project, then run bundle install.

Rails 4.1.8 actually generates an app's Gemfile with debugger commented out, so it should already work fine.

If you actually need a debugger, you can use byebug, a replacement for debugger for Ruby 2.0+. In the upcoming Rails 4.2.0 release it's already baked into the generator.

When creating a new app, you can also add an option -B or --skip-bundle to not run bundle install after creating an app skeleton. Then you can fix your Gemfile and run bundle install yourself in the project's folder. That only saves you a bit of time though.

like image 136
D-side Avatar answered Nov 13 '22 01:11

D-side