I've followed these instructions to install sqlite3 gem : http://docs.webfaction.com/software/rails.html#installing-sqlite3-ruby from source.

Everything worked fine. But when in my rails application directory i try to "bundle install" to install all gems I get this error :

Installing sqlite3 (1.3.3) with native extensions
`rescue in block in build_extensions': ERROR: Failed to build gem native
extension. (Gem::Installer::ExtensionBuildError)

        /home/plehoux/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... yes
checking for sqlite3_initialize()... no
sqlite3-ruby only supports sqlite3 versions 3.6.16+, please upgrade!
*** 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.

I've installed rvm in my home directory and run ruby 1.9.2 and Gem from ~/.rvm directory.

Any idea?

asked 23 Aug '11, 01:04

plehoux's gravatar image

accept rate: 0%

edited 23 Aug '11, 10:32

seanf's gravatar image

seanf ♦♦

Solved! The problem was that we needed to set the sqlite3-ruby installation options via "bundle config".

Here is what finally worked:

bundle config build.sqlite3 --with-sqlite3-include=$HOME/include --with-sqlite3-lib=$HOME/lib --with-sqlite3-dir=$HOME/bin
bundle install

Hope that helps!

permanent link

answered 23 Aug '11, 16:20

seanf's gravatar image

seanf ♦♦
accept rate: 38%


You would need to install Sqlite in your home directory as explained here:

You would then need to install sqlite3-ruby using:

Hope that helps!

permanent link

answered 23 Aug '11, 01:11

neeravk's gravatar image

accept rate: 41%

I already did those two steps.

(23 Aug '11, 01:17) plehoux plehoux's gravatar image

Can you try using the command: "which sqlite3" and see if it references the binary inside your home directory?

(23 Aug '11, 01:27) neeravk neeravk's gravatar image

~/bin/sqlite3 (yes)

(23 Aug '11, 10:12) plehoux plehoux's gravatar image

Please try setting LD_LIBRARY_PATH and LD_INCLUDE_PATH when you run your commands, eg:

LD_INCLUDE_PATH=$HOME/include LD_LIBRARY_PATH=$HOME/lib <your command here>
permanent link

answered 23 Aug '11, 10:39

seanf's gravatar image

seanf ♦♦
accept rate: 38%

LD_INCLUDE_PATH=$HOME/include LD_LIBRARY_PATH=$HOME/lib bundle install

still give the same error.

(23 Aug '11, 11:22) plehoux plehoux's gravatar image

Ok, try this - log out of your current SSH session, log back in, and then run the following commands:

export GEM_HOME=$HOME/.rvm/gems/ruby-1.9.2-p290/gems/
LD_INCLUDE_PATH=$HOME/include LD_LIBRARY_PATH=$HOME/lib bundle install sqlite3
(23 Aug '11, 11:46) seanf ♦♦ seanf's gravatar image

Same error. (tks a lot for your time!) Strangely, if I run "gem install sqlit3-ruby" everything is find.

gem install sqlite3-ruby Fetching: sqlite3-ruby-1.3.3.gem (100%)

Hello! The sqlite3-ruby gem has changed it's name to just sqlite3. Rather than installing sqlite3-ruby, you should install sqlite3. Please update your dependencies accordingly.

Thanks from the Ruby sqlite3 team!

<3 <3 <3 <3

Successfully installed sqlite3-ruby-1.3.3 1 gem installed Installing ri documentation for sqlite3-ruby-1.3.3... Installing RDoc documentation for sqlite3-ruby-1.3.3...

(23 Aug '11, 13:21) plehoux plehoux's gravatar image

You're very welcome!

I don't think we're going to be able to resolve this here in the public forum. If you'd like us to investigate this further, please open a support ticket to give us permission to log into your account and run these commands ourselves. In the ticket, be sure to let us know the exact commands you are running, and the directory from which you are running them. We'll then try running them and try to get it working for you.

(23 Aug '11, 13:38) seanf ♦♦ seanf's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 23 Aug '11, 01:04

question was seen: 3,333 times

last updated: 23 Aug '11, 16:20

Features & prices    Sign up    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
© Copyright 2003-2015 Swarma Limited - WebFaction is a service of Swarma Limited