0

Good day. I'm trying to set up project that's beings worked on by other people.
when i run bundle install it crashes with an error

Installing bcrypt-ruby (3.0.1) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb 
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from extconf.rb:36:in `<main>'


Gem files will remain installed in /home/halfros/.bundler/tmp/9279/gems/bcrypt-ruby-3.0.1 for inspection.
Results logged to /home/halfros/.bundler/tmp/9279/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out
An error occurred while installing bcrypt-ruby (3.0.1), and Bundler cannot continue.
Make sure that `gem install bcrypt-ruby -v '3.0.1'` succeeds before bundling.

sudo gem install bcrypt-ruby -v '3.0.1'

$ sudo gem install bcrypt-ruby -v '3.0.1'
Building native extensions.  This could take a while...
ERROR:  Error installing bcrypt-ruby:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from extconf.rb:36:in `<main>'


Gem files will remain installed in /var/lib/gems/1.9.1/gems/bcrypt-ruby-3.0.1 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out

Tried ths - no changes.
http://rorguide.blogspot.com/2011/02/bundle-install-on-linux-giving-error.html

Elmor
  • 4,775
  • 6
  • 38
  • 70

1 Answers1

1

It looks like the ruby development library isn't installed.

It also looks like you're using global ruby/gems installation, so your easiest fix is to install the ruby1.9-dev package (or something similar), and try again.

Alternatively, you could use rvm and this problem will fix itself: https://rvm.io/

jordanpg
  • 6,386
  • 4
  • 46
  • 70
  • @Jesse's link above contains both of these answers. As does google. – jordanpg Oct 26 '12 at 21:34
  • Didn't find the right answer when I looked for it in google. i use rvm. – Elmor Oct 27 '12 at 08:38
  • Are you sure you're not using a global ruby installation? What is the output of `which ruby`? If you were using rvm, the devel includes would be available to the build process. Read more about compiling native extensions here: http://patshaughnessy.net/2011/10/31/dont-be-terrified-of-building-native-extensions – jordanpg Oct 27 '12 at 23:24