This forum is no longer active. Please post your questions to our new community site

OS X trying to install gem failing with sqlite3.h is missing

Subscribe to OS X trying to install gem failing with sqlite3.h is missing 9 post(s), 2 voice(s)

 
Avatar jwhendy 5 post(s)

HI,

I’m trying to install timetrap with ‘sudo gem install timetrap’ and OS X complained about having too low of a ruby version (1.8.6) so I thought BitNami RubyStack would help. I then tried this:
-
cd /Applications/rubystack-2.1.0
rubyconsole
sudo gem install timetrap - —with-sqlite-dir=/Applications/rubystack-2.1.0/sqlite
-
-

But still get this:
-
Building native extensions. This could take a while…
ERROR: Error installing timetrap:
ERROR: Failed to build gem native extension.

/Applications/rubystack-2.1-0/ruby/bin/ruby extconf.rb —with-sqlite-dir=/Applications/rubystack-2.1.0/sqlite -E
checking for sqlite3.h… no
sqlite3.h is missing. Try ‘port install sqlite3 +universal’
or ‘yum install sqlite3-devel’ and check your shared library search path (the
location where your sqlite3 shared library is located).

  • extconf.rb failed *
    Could not create Makefile due to some reason, probably lack of
    necessary libraries and/or headers. Check the mkmf.log file for more
    details. You may need configuration options.

Provided configuration options:
—with-opt-dir
—without-opt-dir
—with-opt-include
—without-opt-include=${opt-dir}/include
—with-opt-lib
—without-opt-lib=${opt-dir}/lib
—with-make-prog
—without-make-prog
—srcdir=.
—curdir
—ruby=/Applications/rubystack-2.1-0/ruby/bin/ruby
—with-sqlite3-dir
—without-sqlite3-dir
—with-sqlite3-include
—without-sqlite3-include=${sqlite3-dir}/include
—with-sqlite3-lib
—without-sqlite3-lib=${sqlite3-dir}/lib

Gem files will remain installed in /Applications/rubystack-2.1-0/ruby/lib/ruby/gems/1.8/gems/sqlite3-1.3.3 for inspection.
Results logged to /Applications/rubystack-2.1-0/ruby/lib/ruby/gems/1.8/gems/sqlite3-1.3.3/ext/sqlite3/gem_make.out
-

I don’t get it. Is RubyStack missing something? I actually have two instances of sqlite3.h, one in /usr/local from a previous attempt to install 1.8.7 via “One Click Ruby Installer” and no fidgeting with trying to pass sqlite include directory options worked. I clearly see sqlite3.h… but it’s not being found or there is some other issue.

Should I be able to install a gem with RubyStack installed using the rubyconsole or do I need XCode developer tools and all of gcc as well?

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

Could you try the following?


$ gem install sqlite3 -- --with-sqlite3-dir=/Applications/rubystack-2.1-0/sqlite  --debug
 
Avatar jwhendy 5 post(s)

Thanks — is it as simple as needing the Developer Tools installed? I just did that and it now works. Or should what I needed have been present with the BitNami stack and I just wasn’t indicating —options right? If it should have worked with BitNami alone, I’ll uninstall the OS X Developer Tools and continue debugging. I’d prefer not to have them since they take quite a bit of space!

 
Avatar jwhendy 5 post(s)

Just ditched xcode and tried your code and got the same as above, minus the section about available options. Let me know if there’s a particular file you want the contents of. Thanks again. I found out that I can just install the gcc component of xcode, so I’m going to try that. There were some threads on stackexchange that seemed to indicate that gcc was necessary to build some gems. Maybe it’s as simple as that.

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

The Xcode tools are necessary for some gems, for which of them which requires compilation. The sqlite3 gem requires to be compiled so it is necessary compilation tools: gcc, make,..

 
Avatar jwhendy 5 post(s)

Yes — I see that it works with Xcode, but I guess I was trying to figure out which specific packages are required. Xcode now allows custom installation of only select packages. For example, there is a pkgs folder with gcc-4.2.pkg in it, but installing that did not help, even though sqlite.h exists. I’m trying to identify what, exactly, ruby is looking for to build gems. If you go the “standard route,” Xcode will install “Xcode Developer Essentials” which is a tooon of crap (2 GB) that I don’t need — bluetooth SDKs, Xcode IDE, etc. I’ll never touch that stuff and thus just finding the package with the c headers or whatever else would be fantastic!

I do appreciate your persistence and suggestions!

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

The SQLite headers and libraries are in the “your_installdir/sqlite” folder so if you specify the location of this folder during the gem installation should work.

 
Avatar jwhendy 5 post(s)

Isn’t that what we tried with this: “$ gem install sqlite3 — —with-sqlite3-dir=/Applications/rubystack-2.1-0/sqlite —debug”? That didn’t do anything different for me. I’m thinking you’re saying I need gcc + sqlite libraries/headers. So are you saying that as long as I could issue “which gcc” and have a proper answer, and have the BitNami RubyStack… I should be okay?

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

Yes you need the gcc, make,.. the basic compilation tools. The sqlite libraries and headers are shipped in RubyStack. We will try to include this gem in the next release to avoid compilation issues. Thanks for reporting it.