Topic: Gem update / install issue - ERROR: Failed to build gem native ext...
I noticed I didn't have sqlite3 installed so I did a sudo gem install sqlite3-ruby only to get the following error
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension./usr/local/bin/ruby extconf.rb update
creating Makefile
When I do a sudo gem update the gems that need updating (in my case RedCloth) will also give the same error.
Here is the full output when running 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./usr/local/bin/ruby extconf.rb instal sqlite3-ruby
checking for fdatasync() in -lrt... no
checking for sqlite3.h... yes
checking for sqlite3_open() in -lsqlite3... nomake
make: *** No rule to make target `ruby.h', needed by `sqlite3_api_wrap.o'. Stop.Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out
Macintosh:~ Tate$ 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./usr/local/bin/ruby extconf.rb install sqlite3-ruby
checking for fdatasync() in -lrt... no
checking for sqlite3.h... yes
checking for sqlite3_open() in -lsqlite3... nomake
make: *** No rule to make target `ruby.h', needed by `sqlite3_api_wrap.o'. Stop.Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out
From all the google searches I've done, people have suggested that the ruby install is broken - I've seen a few solutions, but they were for Linux or Windows machines.
I'm on OSX 10.5 Leopard ~ does anyone have any clues? I have installed and updated gems before without this issue, most recently RedCloth (though I can't remember if that was pre or post Rails 2.1)
Last edited by riot (2008-09-04 23:16:19)