Can't install sqlite3-ruby gem on Mac OS X 10.5 Leopard

I have a fresh installation of Leopard on my laptop. When I ran “sudo
gem update --system” it seemed to wipe out all of my gems. Weird. I
was able to reinstall with “sudo gem install rails --include-
dependencies” but I can’t get the sqlite3-ruby gem to install.

This is what I get:

bash-3.2$ sudo gem install sqlite3-ruby
Bulk updating Gem source index for:
Select which gem to install for your platform (universal-darwin9.0)

  1. sqlite3-ruby 1.2.1 (mswin32)
  2. sqlite3-ruby 1.2.1 (ruby)
  3. sqlite3-ruby 1.2.0 (mswin32)
  4. sqlite3-ruby 1.2.0 (ruby)
  5. Skip this gem
  6. Cancel installation

Building native extensions. This could take a while…
ERROR: While executing gem … (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

ruby extconf.rb install sqlite3-ruby
checking for sqlite3.h… yes
checking for sqlite3_open() in -lsqlite3… no

make: *** No rule to make target ruby.h', needed bysqlite3_api_wrap.o’. Stop.

Gem files will remain installed in /Library/Ruby/Gems/gems/sqlite3-
ruby-1.2.1 for inspection.
Results logged to /Library/Ruby/Gems/gems/sqlite3-ruby-1.2.1/ext/

I have Xcode tools installed and everything. How can I get this
working? I need to get this working as soon as I can.


Hi partydrone:

Download sqlite3 source code, extract, configure with prefix /usr/local,
make and make install.

Then run this line to set the architecture flags to your specific CPU
and install sqlite3-ruby:

sudo env ARCHFLAGS="-arch i386" gem install sqlite3-ruby

sudo env ARCHFLAGS="-arch ppc" gem install sqlite3-ruby

From the list, select the newest for ruby, that would be #2.

Good luck.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs