1

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 ?

Dty
  • 12,253
  • 6
  • 43
  • 61
Hemanth
  • 5,035
  • 9
  • 41
  • 59

2 Answers2

2

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 clang compiler and development header files (ruby.h among others).

Recent version of XCode are available on the App Store. Although by default, XCode no longer installs the developers tools in a way that makes them accessible from the shell, you can fix that by installing "Command Line Tools" from under the Download tab of the XCode IDE preference window.

See this other answer for more details.

Community
  • 1
  • 1
Alex Jasmin
  • 39,094
  • 7
  • 77
  • 67
  • Even after installing the (3 GB sized)Xcode package from the above said link , gcc is not installed yet.I get "gcc command not found" when I try gcc --version. Could it be some path setting issue?? – Hemanth Nov 04 '10 at 05:27
  • On my system /usr/bin/gcc is a symlink to /usr/bin/gcc-4.2 I'm almost certain this was create automatically by the XCode install. According to http://stackoverflow.com/questions/1810327/cant-use-gcc-in-os-x-terminal it should work at that point. Though the poster of that question fixed his problem by reinstalling XCode. – Alex Jasmin Nov 04 '10 at 05:49
  • worked . .My xcode installation was not proper. Thanks it works well :) – Hemanth Nov 05 '10 at 18:46
0

Snow Leopard upgrade -> reinstalling sqlite3-ruby gem problem

Community
  • 1
  • 1
thenengah
  • 42,557
  • 33
  • 113
  • 157