Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't install the sqlite3 gem on mac osx 10.8.2

My bundle install is not working and I get this error:

Installing sqlite3 (1.3.6) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/Frank/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb --with-sqlite3-       include=/Users/Frank/include --with-sqlite3-lib=/Users/Frank/lib --with-sqlite3-dir=/Users/Frank/bin
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... yes
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
checking for sqlite3_open_v2()... yes
checking for sqlite3_prepare_v2()... yes
checking for sqlite3_int64 in sqlite3.h... yes
checking for sqlite3_uint64 in sqlite3.h... yes
creating Makefile

Which I think it has to do with the libsql-dev thats not working. but then I get this

make
compiling backup.c
In file included from ./sqlite3_ruby.h:51,
             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 /Users/Frank/gems/gems/sqlite3-1.3.6 for inspection.
Results logged to /Users/Frank/gems/gems/sqlite3-1.3.6/ext/sqlite3/gem_make.out

An error occurred while installing sqlite3 (1.3.6), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.

I started getting it randmoly today and I can't run my rails apps without it. What can I do?

like image 813
frank Avatar asked Nov 13 '22 14:11

frank


1 Answers

Was having this issue recently. Had to open up the XCode tools and accept the terms of service. Then everything worked fine. (Make sure you have XCode installed first)

like image 99
David Avatar answered Nov 15 '22 04:11

David