You are not logged in.

#1 2011-05-26 01:47:01

Cyphus
Member
Registered: 2011-05-26
Posts: 5

[SOLVED] gem install sqlite3 fails

I know there is a very similar post here but since it's 2 years old and still unanswered I thought I'd give it another try.

Some versions to prove everything needed is installed and I'm at least somewhat sane:

sqlite3 -version
3.7.6.3
ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
gem -v
1.8.3

And the error:

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

        /usr/bin/ruby extconf.rb
checking for sqlite3.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/ruby
        --with-sqlite3-dir
        --without-sqlite3-dir
        --with-sqlite3-include
        --without-sqlite3-include=${sqlite3-dir}/include
        --with-sqlite3-lib
        --without-sqlite3-lib=${sqlite3-dir}/lib
/usr/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from /usr/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp'
        from /usr/lib/ruby/1.9.1/mkmf.rb:853:in `block in find_header'
        from /usr/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
        from /usr/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
        from /usr/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from /usr/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
        from /usr/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from /usr/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
        from /usr/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
        from /usr/lib/ruby/1.9.1/mkmf.rb:852:in `find_header'
        from extconf.rb:28:in `<main>'


Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3 for inspection.
Results logged to /usr/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3/ext/sqlite3/gem_make.out

EDIT: Here's the mkmf.log it wants you to check:

"gcc -o conftest -I/usr/include/ruby-1.9.1/x86_64-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -I/usr/include -I/usr/local/include -I/opt/local/include -I/sw/local/include -I/usr/include    -march=x86-64 -mtune=generic -O2 -pipe -fPIC conftest.c  -L. -L/usr/lib -L/usr/local/lib -L/opt/local/lib -L/sw/local/lib -L/usr/lib -L. -Wl,--hash-style=gnu -Wl,--as-needed -rdynamic -Wl,-export-dynamic     -lruby-static  -lpthread -lrt -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */

My first thoughts were that I needed to specify where to find sqlite3.h so I tried this:

gem install sqlite3 -- --with-sqlite3-include=/usr/include

Same error. Also, specifying --with-sqlite3-dir to give gem a general idea of where to find the files doesn't help. I've confirmed that /usr/include/sqlite3.h exists, as well as the proper lib, and I'm running out of ideas.

At the very least I'd like to see someone else with a working configuration. Maybe we can compare version numbers, but even that's a real stretch.

Last edited by Cyphus (2011-05-26 02:57:59)

Offline

#2 2011-05-26 03:01:41

Cyphus
Member
Registered: 2011-05-26
Posts: 5

Re: [SOLVED] gem install sqlite3 fails

The Solution:

In order for sqlite3 gem to install you need both gcc and make.

I'm rather new to Arch, so what would be the best course of action to see that this doesn't happen to someone else? Can we make gcc and make a dependency? To which package: sqlite3 or ruby?

Thanks in advance.

Offline

#3 2011-05-26 03:07:53

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] gem install sqlite3 fails

https://wiki.archlinux.org/index.php/AUR#Prerequisites
Those packages are expected to be installed if you're using AUR.

I'm not sure if this applies to your situation.

Last edited by karol (2011-05-26 03:17:05)

Offline

Board footer

Powered by FluxBB