Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Sqlite3 Gem Error

Tags:

sqlite

macos

gem

I'm getting the following error when trying to install the Sqlite3 gem on OS X Lion with XCode 4.2 installed:

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

        /Users/me/.rvm/rubies/ruby-1.9.3-p0/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()... yes
checking for sqlite3_backup_init()... yes
checking for sqlite3_column_database_name()... no
checking for sqlite3_enable_load_extension()... yes
checking for sqlite3_load_extension()... yes
creating Makefile

make
compiling backup.c
make: /usr/bin/gcc-4.2: No such file or directory
make: *** [backup.o] Error 1

Would linking to /usr/bin/llvm-gcc-4.2 be the only fix (seems a little hack-y)? Or am I missing something?

like image 267
Bullines Avatar asked Dec 08 '11 00:12

Bullines


1 Answers

It would appear that XCode 4.2 doesn't install gcc-4.2, but instead llvm-gcc-4.2. Clearly Apple feels that LLVM is mature enough to superseed GCC.

There are two options I can think of. You should be able to choose either and be OK.

  1. Use this GCC installer.

  2. Symlink LLVM using sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2.

like image 65
Alex Avatar answered Oct 06 '22 14:10

Alex