Search code examples
ruby-on-rails-3sqliterhomobile

Installing sqlite3 gem is not working on my Linux Mint x64


I've found lots of these questions around, but none of the solutions given work. I also haven't seen x64 mentioned, so maybe that is related.

The issue is this:

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

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

What I've tried so far:

  • installing sqlite3 & libsqlite3-dev through apt
  • installing sqlite3 using newest binaries from http://www.sqlite.org/
  • specifying sqlite3-dir (gem install sqlite3 -- --with-sqlite3-dir=/usr/local/lib)

I'm a little desperate at this point. Any thoughts?


Solution

  • /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)

    This says it can't find the file mkmf. This file comes with -dev ruby builds. For ruby1.9.1 like you're error message says you're running, you need to have ruby1.9.1-dev installed

    sudo aptitude install ruby1.9.1-dev
    

    Mint is just a derivative of Ubuntu, so it's worth your while to search for people running Ubuntu having issues like this as well. For example: `require': no such file to load -- mkmf (LoadError)