small medium large xlarge

Generic-user-small
21 Jan 2009, 06:21
Robert Marcroft (2 posts)

I keep getting stumped when I run “sudo gem install sqlite3-ruby” I’ve been googling the heck out of this problem but I seem to be going in circles I running Mac OS X version 10.5.6 Here is what I get. robert-lname-macbook-pro:~ robertlname$ 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 install sqlite3-ruby can’t find header files for ruby.

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out

Then I tryed robert-lname-macbook-pro:~ robertlname$ sudo gem install sqlite3-ruby – with-sqlite3-dir=/opt/local Password: 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 install sqlite3-ruby – with-sqlite3-dir=/opt/local can’t find header files for ruby.

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out robert-lname-macbook-pro:~ robertlname$ Failed to build gem native extension.

Thank You

Samr_small_pragsmall
21 Jan 2009, 16:24
Sam Ruby (634 posts)

Did you install “Apple’s Xcode Developer Tools (version 3.1 or later for Leopard, or 2.4.1 or later for Tiger), found at the Apple Developer Connection site or on your Mac OS X installation CDs/DVD.”? This should have been required in order to install MacPorts as well as being needed for this step.

Generic-user-small
22 Jan 2009, 21:02
Robert Marcroft (2 posts)

Thank you that is exactly what I needed to get sqlite3 up and running. This may be a helpful tip to add to the book.

Samr_small_pragsmall
23 Jan 2009, 00:54
Sam Ruby (634 posts)

That puzzles me is how you skipped this… with a Mac there are all sorts of different starting points and different ways to get to where you want to go, and the result would be a complex flow chart. Prior editions pointed to external sites that no longer are active.

After trying various approaches, I felt that describing a single and simple approach was best, and knowing that installing MacPorts required you to install Xcode Developer Tools, it didn’t seem necessary to mention it again when you are installing sqlite3.

Generic-user-small
24 Jan 2009, 10:55
KenA (16 posts)

I had the same issue and Xcode installation solved it, but we should be able to install sqlite without Xcode … Xcode probably installs some sqlite dependencies which of course I don’t know of … so … install Xcode and bloat up your mac :-(

Generic-user-small
27 Jan 2009, 22:03
Andrew Savory (1 post)

Having just tried this on a bare machine (stripped down eeepc 901) I can confirm that (a) XCode is required and (b) it’s not unusual for people not to have installed it. For some of us, every mb counts!

It would definitely be good to either identify the dependency or to add a note to that chapter advising people to install XCode.

Generic-user-small
28 Feb 2009, 13:52
Jan Klosinski (1 post)

Thanks for the info, it helped me out as well.

Comic-560x560_pragsmall
05 Mar 2009, 00:48
Conrad Taylor (10 posts)

Hi, I agree with Sam Ruby in this regard because if you’re a developer on the Mac, then Xcode Developer Tools is one of the first things that one should install. Also, it’s required to install any port and most Ruby gems. Next, I really don’t want to buy a book that spends several chapters in explaining the many different ways to set up a development environment to use the Rails framework. This could be a book in its own right if one was to do such a thing. In short, the goal of the book is to learn about the Rails framework because there’s just two many installation options for installing and configuring Rails.

Just my 2 cents,

-Conrad

Generic-user-small
05 Mar 2009, 04:17
James West (104 posts)

Having exactly the same problem on my win xp machine. I decided to try to update my rails installation to 2.3 and it’s fallen over in a big heap.

So if anyome has any ideas on how to fix this for XP I’d appreciate it.

James

Comic-560x560_pragsmall
05 Mar 2009, 12:38
Conrad Taylor (10 posts)

James, could you provide more details as to the errors that you’re seeing when try to install the sqlite3-ruby? In any case, please give the following steps a try:

http://sunskycom.blogspot.com/2008/08/install-sqlite3-on-windows-for-ruby-on.html

Good luck,

-Conrad

Generic-user-small
12 Jun 2009, 02:23
Michael Loegering (1 post)

Not quite sure what was going on here, but I had a similar problem (dev tools, port already installed):

$ 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 checking for fdatasync() in -lrt… no checking for sqlite3.h… yes checking for sqlite3_open() in -lsqlite3… no

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

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out ———–

I guess it had something to do with a flag because $ sudo env ARCHFLAGS=”-arch i386” gem install sqlite3-ruby

worked fine. To be fair I did have another version of sqlite3 kicking around, so maybe the compile on that one made the flag necessary.

Generic-user-small
07 Oct 2009, 14:26
Martin Fencl (1 post)

I am having a similar problem, and after a full day on it, I got nowhere. I tried everything that I found on the web. Yesterday was the first time I used Sqlite3 in a (testing) project. Sqlite3 was probably not working all this time after upgrade to Snow Leopard.

➜ ~ $ sudo gem install sqlite3-ruby Password: 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 checking for fdatasync() in -lrt… no checking for sqlite3.h… yes checking for sqlite3_open() in -lsqlite3… no ** 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-sqlite3lib

Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.5 for inspection. Results logged to /usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.5/ext/sqlite3_api/gem_make.out ➜ ~ $

Help would be greatly appreciated.

Thanks, martin

Generic-user-small
17 Dec 2009, 11:37
Dopler (1 post)

Also having trouble, and have seemingly exhausted googled solutions and myself.

I’m on Red Hat Linux and get an error installing sqlite3-ruby:

checking for fdatasync() in -lrt… yes checking for sqlite3.h… no ** extconf.rb failed **

This means I need sqlite3 development libraries?

I fail to find this resource for red hat. Any suggestions?

Much appreciations…

Generic-user-small
03 Jan 2011, 11:05
Mike Pountney (1 post)

I had a similar problem on MacOS 10.6.5 with XCode 3.2.5, installing the sqlite3-ruby gem via a homebrew installed ruby 1.9.

Turned out this was caused by a conflict with gem/sqlite3 installed via MacPorts (in /opt/local). I removed /opt/local and the sqlite3-ruby gem installed successfully.

Bit of an extreme fix I know, but Homebrew recommends not running in tandem with Fink/MacPorts, and there was nothing in /opt/local I can’t get via brew.

Generic-user-small
05 Jan 2011, 18:30
Aleks (5 posts)

I have a similar problem updating the sqlite3-ruby gem on MacOS 10.6.5 with XCode 3.2.5 with Ruby 1.8.7. The same error comes up when I try to install bundle on page 180.

Updating installed gems Updating 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 checking for sqlite3.h… yes checking for sqlite3_libversion_number() in -lsqlite3… yes checking for rb_proc_arity()… no checking for sqlite3_initialize()… yes checking for sqlite3_next_stmt()… yes checking for sqlite3_column_database_name()… no checking for sqlite3_enable_load_extension()… no checking for sqlite3_load_extension()… no creating Makefile

make make: *** No rule to make target defines.h', needed by backup.o’. Stop.

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.2 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.2/ext/sqlite3/gem_make.out Nothing to update

Any help would be much appreciated.

Generic-user-small
05 Jan 2011, 23:15
Aleks (5 posts)

Figured it out. I have uninstalled Macports, reinstalled ruby, rails and gem. It has done the trick.

You must be logged in to comment