Cannot install sqlite3 on OSX Lion

I don’t like my first post to be a question but after many hours staring at google search results, I have reached a dead end.

The original problem is that I received the following error when installing Sql Lite (sqlite3-ruby):

ERROR: Failed to build gem native extension

I’ve put the full error message at the bottom…

I have since followed various advice including:

  • adding --with path to the installer
  • getting a list of available versions and installing a specific one
  • using the which command to get the correct location for the --with command
  • several posts advised to just work through the steps again, i’ve done this several times
  • I even tried to cheat by using the mysql gem (which installed first time), however, when I came to start mongrel it then complained about sqlite being missing

I am following the Simply Rails 2 Book and have had problems at almost every step, I’ve put most of this down to Lion as the book does not cover that. But I am now at a point where I cannot continue.

Can anyone point me towards EITHER getting SQL lite working OR completing the book with mysql.

… punch and pie


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

        /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... no
checking for sqlite3_initialize()... yes
checking for sqlite3_backup_init()... yes
checking for sqlite3_column_database_name()... no
checking for sqlite3_enable_load_extension()... no
checking for sqlite3_load_extension()... no
creating Makefile

make
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -DHAVE_SQLITE3_INITIALIZE -DHAVE_SQLITE3_BACKUP_INIT  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common  -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common   -c backup.c
In file included from ./sqlite3_ruby.h:42,
                 from backup.c:3:
./backup.h:7: error: expected specifier-qualifier-list before ‘sqlite3_backup’
backup.c: In function ‘initialize’:
backup.c:63: error: ‘sqlite3_backup’ undeclared (first use in this function)
backup.c:63: error: (Each undeclared identifier is reported only once
backup.c:63: error: for each function it appears in.)
backup.c:63: error: ‘pBackup’ undeclared (first use in this function)
backup.c:77: error: ‘sqlite3BackupRuby’ has no member named ‘p’
backup.c: In function ‘step’:
backup.c:101: error: ‘sqlite3BackupRuby’ has no member named ‘p’
backup.c:102: error: ‘sqlite3BackupRuby’ has no member named ‘p’
backup.c: In function ‘finish’:
backup.c:115: error: ‘sqlite3BackupRuby’ has no member named ‘p’
backup.c:116: error: ‘sqlite3BackupRuby’ has no member named ‘p’
backup.c:117: error: ‘sqlite3BackupRuby’ has no member named ‘p’
backup.c: In function ‘remaining’:
backup.c:133: error: ‘sqlite3BackupRuby’ has no member named ‘p’
backup.c:134: error: ‘sqlite3BackupRuby’ has no member named ‘p’
backup.c: In function ‘pagecount’:
backup.c:149: error: ‘sqlite3BackupRuby’ has no member named ‘p’
backup.c:150: error: ‘sqlite3BackupRuby’ has no member named ‘p’
make: *** [backup.o] Error 1


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.5 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.5/ext/sqlite3/gem_make.out

Update

I have given up :slight_smile:

…for now.

Followed every bit of advice I could find, and always end up back with the same error.

Have got it working with MySQL for now as I want to get started.

Really suspect this is something to do with lion and versions but just haven’t figured it out yet. If anyone else does find a solution, I’d be interested to hear it, but for now I’m plodding along with MySQL.

Did you ever find a solution? I am having the same problem. Updated to Lion - dealt with issue after issue but I’m at a dead stop with installing sqlite3-ruby. Our errors are identical. Ugh.