0
votes

I am trying to install the datamapper gem on mac os x lion but am getting failed to build gem native extension while installing the sqlite adapter (see terminal output below). The two solutions I found from google and other stack overflow questions have been to use sudo or install Xcode but I am already using sudo and have Xcode 4.3.3 installed from the app store.

sudo gem install dm-sqlite-adapter Password: Building native extensions. This could take a while... ERROR: Error installing dm-sqlite-adapter: 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/do_sqlite3-0.10.8 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/do_sqlite3-0.10.8/ext/do_sqlite3/gem_make.out

gem_make.out

/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

1
Can you paste the error lines at the end of the gem_make.out file? They might give us a clue on how to approach this.Amir
@AmirF Update question with contents of the gem_make.out fileBen

1 Answers

1
votes

Ok so it looks like you're missing the Xcode Preferences-General the Xcode Command Line Tools.

Without the Command Line Tools the above errors are generated, you can download them from http://developer.apple.com/downloads (free Apple ID required).

From the description of the Xcode CLI Tools:

This package enables UNIX-style development via Terminal by installing command line developer tools, as well as Mac OS X SDK frameworks and headers. Many useful tools are included, such as the Apple LLVM compiler, linker, and Make. If you use Xcode, these tools are also embedded within the Xcode IDE, and can be installed on your system using the Downloads preferences pane within Xcode 4.3 and later. This package requires Mac OS X 10.7.3 or later.

Also, see this article which suggest you uninstall xcode as well before.