Rails Installation Failed on Ubuntu With "Cannot Load Such File - Mkmf"

`require': no such file to load -- mkmf (LoadError)

After some search for a solution it turns out the -dev package is needed, not just ruby1.8. So if you have ruby1.9.1 doing

sudo apt-get install ruby1.9.1-dev

or to install generic ruby version, use (as per @lamplightdev comment):

sudo apt-get install ruby-dev

should fix it.

Try locate mkmf to see if the file is actually there.

Unable to install gem - Failed to build gem native extension - cannot load such file -- mkmf (LoadError)

There are similar questions:

  • `require': no such file to load -- mkmf (LoadError)
  • Failed to build gem native extension (mkmf (LoadError)) - Ubuntu 12.04

Usually, the solution is:

sudo apt-get install ruby-dev

Or, if that doesn't work, depending on your ruby version, run something like:

sudo apt-get install ruby1.9.1-dev

Should fix your problem.


Still not working? Try the following after installing ruby-dev:

sudo apt-get install make

Failed to build gem native extension (mkmf (LoadError)) - Ubuntu 12.04

Possible duplicate of:

Unable to install gem - Failed to build gem native extension - cannot load such file -- mkmf (LoadError)

Depending on your ruby version, run:

sudo apt-get install ruby1.9.1-dev

Error installing gem failed to build gem native extensions -- cannot load such file -- mkmf

if you're using RVM, you shouldn't ever be using 'sudo'. Using sudo calls libs and such out of the rvm path. Try just a flat

gem install thin

and see if that helps.

~Kevin



Related Topics



Leave a reply



Submit