1

I have installed ruby on rails using rvm. I am using 2.2.0 ruby and 4.2.0 Rails. I tried running bundle install on an older project that I developed on a former pc but I get :

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

    /home/florin/.rvm/rubies/ruby-2.2.3/bin/ruby -r ./siteconf20151003-6297-foug8b.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=/home/florin/.rvm/rubies/ruby-2.2.3/bin/$(RUBY_BASE_NAME)
/home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:1391:in `initialize': No such file or directory @ rb_sysopen - ./223/ruby_debug.h (Errno::ENOENT)
    from /home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:1391:in `open'
    from /home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:1391:in `copy_file'
    from /home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:485:in `copy_file'
    from /home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:402:in `block in cp'
    from /home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:1570:in `block in fu_each_src_dest'
    from /home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:1584:in `fu_each_src_dest0'
    from /home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:1568:in `fu_each_src_dest'
    from /home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:401:in `cp'
    from extconf.rb:83:in `block in <main>'
    from extconf.rb:82:in `each'
    from extconf.rb:82:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /home/florin/.rvm/gems/ruby-2.2.3/gems/debugger-1.6.8 for inspection.
Results logged to /home/florin/.rvm/gems/ruby-2.2.3/extensions/x86_64-linux/2.2.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.

Reading the internet I tried installing all the dev things like : sudo apt-get install libpq-dev

sudo apt-get install libmysqlclient-dev
sudo apt-get install libpq-dev
sudo apt-get install libsqlite3-dev
sudo apt-get install libev-dev

but it didn't work.

5
  • Perhaps an issue with the debugger gem?
    – Jan
    Oct 3, 2015 at 12:14
  • I don't think so . On my older pc it worked fine which is odd for me. That was ubuntu 12.00 clean install . Now I have a virtual machine with 14.04 could the virtua machine pose any problems ? I know that last time I installed rails I didn't need to do so much configuration . Oct 3, 2015 at 12:16
  • No, it shouldn't matter if it's a VM or not.
    – Jan
    Oct 3, 2015 at 12:17
  • Hmm . I will try to delete it then from the gemfile since I use pry anyway. Would be nice to know if it's a dependency I missed (don't know about) Oct 3, 2015 at 12:19
  • Seems that the other 200 gems installed correctly . Oh well . I will leave the question open maybe someone has any idea . Thanks for your interest and help Jan ! (on both questions) Oct 3, 2015 at 12:21

1 Answer 1

2

I had the same thing happen to me when I moved from ruby-1.9.3-p385 up to ruby-2.2.3.

It looks like when you generate the project, Rails will use the appropriate gems for the Ruby version, which aren't guaranteed to work for other Ruby versions.

In this case, debugger doesn't support Ruby past 2.1.1, and you can get this to work replacing:

gem 'debugger'

with:

gem 'byebug'

in your Gemfile.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .