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
Tagged , ,

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

  1. Theepan says:

    Thanks Man… I been searching for the solution………… I guess installing 1.8 worked out…thanks again.

  2. kay says:

    a lot of thanks, working for some time for a solution, now with your suggestion it works…. great!

  3. Rafa says:

    THANKS A LOOOOT!!!!!!!

  4. Chris says:

    Thanks a lot for this!

  5. Jon301 says:

    Thanks, it works ;)

  6. duischen says:

    You saved my day!, thanks in advance. But you should install g++ in order to make the native extensions

  7. Zaid says:

    thanks, that worked.

  8. 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 !

  9. Thanks! Worked like a charm. And very clear and to the point description! Ahhh, I was almost scared away from ruby but you rescued me from the brink.

  10. sealong says:

    Thanks!!!!

  11. greenmang0 says:

    thanks, it helped!

  12. Eder says:

    Ok… thanks your help i can installed the passenger

  13. creativeboulder says:

    Thanks. Worked perfect.

  14. This helped a lot. Thanks!!

  15. alpha01 says:

    Installing phusion passenger can’t get any more easier

  16. Joshua Price says:

    perfect :)

  17. greenmang0 says:

    thanks

  18. MightyUhu says:

    Thank you very much! That helped a lot installing remora.

  19. Casey says:

    Thanks! This helped me a lot :)

  20. Casey says:

    Thanks! This helped me a lot :) -KC

  21. Shalini says:

    Thanks a ton this worked for me …. I was struggling with this error :-)

  22. Will.I.Am says:

    This was a help..thanks..saved a lot of time of scouring the net…

  23. ditHiplilk says:

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

  24. callaly says:

    You helped me a great favor! ^-^

  25. Celso Dantas says:

    thanks!!

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

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: