FIXED: extconf.rb:8:in `require': no such file to load — mkmf (LoadError)

While reading Linux Journal Issue 181 today, I stumbled upon a section explaining about running Ruby on Rails on Apache using an Apache module called Phusion Passenger, also known as mod_rails.

To install Passenger, I followed the instruction provided in the magazine:

sudo gem install passenger

Unxpectedly, I got the following error:

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

/usr/bin/ruby1.8 extconf.rb
extconf.rb:8:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:8

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/fastthread-1.0.7 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/fastthread-1.0.7/ext/fastthread/gem_make.out

What’s happening? What did I do wrong?

According to a blog post by Al Hoang, a Ruby dev package needed to be installed. Well, I wouldn’t have a clue about this!

So, to FIX this, I need to install ruby1.8-dev:

$ sudo apt-get install ruby1.8-dev
...

Now, I’m ready to install Passenger gem:

$ sudo gem install passenger
Building native extensions. This could take a while...
Successfully installed passenger-2.2.4
1 gem installed
Installing ri documentation for passenger-2.2.4...
Installing RDoc documentation for passenger-2.2.4...

Credit: Fixing ‘mkmf’ load error Ruby in Ubuntu

About these ads

26 thoughts on “FIXED: extconf.rb:8:in `require': no such file to load — mkmf (LoadError)

  1. ljeremie says:

    Hi,
    I experienced the same problem on Debian and after I tried your solution I had another problem :
    ——–
    ERROR: Error installing passenger:
    ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.8 extconf.rb install passenger
    creating Makefile

    make
    sh: make: command not found
    ———-
    I solved my problem by typing :
    sudo apt-get install build-essential

    I hope it will help !

  2. ditHiplilk says:

    квашенная капуста для похудениялегкий способ похудеть картвиноградный сокпохудениедиета при раке легкихдиета при нарушении углеводного обменадиета из белков и грейпфрутовкниги андрее малахова о диете на 2009маша малиновская ее секрет похудениякак быстро похудеть на 20кг диетакак действует антицеллюлитный массажлекарство для похудения вен петанти белковая диетадиета при почечные коликиошибки сидящих на диетеджуди мезл новая голивудская диетакак похудеть дневники читательницштаны антицеллюлитные жезанкефирные14 дневные диетыкодирование от лишнего веса по методу смеловакак разнообразить 20 дневную диету

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s