views:

55

answers:

2

I tried to install it as below but it throws error :-

"sudo 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-ruby-1.3.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.1/ext/sqlite3/gem_make.out  

Some information about my system:-

ruby -v 1.8.7
rails -v 3.0.1
gem -v 1.3.7
sqlite3 --version 3.6.12

Also how to even check if the ruby interface for sqlite3 is installed in my system?
Like we "rails-v" to check if rails is installed in our system.I didn't find any commands over the web to check if ruby-interface for sqlite3 is installed in my system ?

+2  A: 

In order to compile native code on OS X (such as this native Ruby extension) you have to install Apple XCode.

XCode includes various developer tools such as the gcc compiler and development header files (ruby.h among others).

There should be an installer for XCode on your OS X DVD under Optional Installs/Xcode.mpkg. You can also download the latest release from http://developer.apple.com/devcenter/mac. (A free registration is required).

To install XCode double click on the .mpkg file in the Finder and follow the instructions on the screen.

Alexandre Jasmin