0
votes

I run the following command and am seeing the below issue...

$ sudo gem install sqlite3-ruby OR $ sudo env ARCHFLAGS="-arch x86_64" gem install sqlite3-ruby 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

mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

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

So its clear that I'm missing some headers, etc because the gods at Apple decided that I wouldn't need that stuff.

Is there anyway I can install all this stuff without having to install XCode? Or do you guys recommend that I install XCode to get some other stuff ... I just hate having to download that 4.5GB package.

2

2 Answers

0
votes

You won't be able to build any gems that use native code without gcc, which is included in the dev tools, so you may as well install them. It isn't just the sqlite headers that are missing.

0
votes

You need to install XCode to get the development tools, including gcc which you need to compile the native C extensions in the sqlite3 gem.

If you are doing any development on Mac OS X you will be endlessly frustrated until you install the developer tools. It is annoying, but much better than trying to get your own tools up an running by downloading binaries or something like that. Down that road lies madness.