Can't install sqlite-ruby gem on OS X 10.5.5

9 views
Skip to first unread message

Adam Morris

unread,
Jan 24, 2009, 1:12:44 PM1/24/09
to rubyonra...@googlegroups.com
I'm new to OS X. I've been messing with Rails for about a year.

I've cloned my rails app using git. script/server starts, and I get an
error in my browser about sqlite3.

So, I try to install sqlite-ruby gem and I fail as follows:


[lostsync@alice ~/projects/motleylane-deploy]$ sudo gem install
sqlite-ruby
Password:
Building native extensions. This could take a while...
ERROR: Error installing sqlite-ruby:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb install sqlite-ruby
checking for main() in -lsqlite... no
checking for sqlite.h... 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:

/* snipped */

Gem files will remain installed in
/usr/local/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3 for inspection.
Results logged to
/usr/local/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3/ext/gem_make.out

[lostsync@alice ~/projects/motleylane-deploy]$ which sqlite3
/usr/bin/sqlite3


I cannot figure this out and Google is not turning up much help.
Thanks.
--
Posted via http://www.ruby-forum.com/.

Frederick Cheung

unread,
Jan 24, 2009, 1:13:46 PM1/24/09
to rubyonra...@googlegroups.com

On 24 Jan 2009, at 18:12, Adam Morris wrote:

>
> I'm new to OS X. I've been messing with Rails for about a year.
>
> I've cloned my rails app using git. script/server starts, and I get
> an
> error in my browser about sqlite3.
>
> So, I try to install sqlite-ruby gem and I fail as follows:
>

Are the dev tools installed ?

Fred

Adam Morris

unread,
Jan 24, 2009, 1:36:17 PM1/24/09
to rubyonra...@googlegroups.com
Frederick Cheung wrote:
> Are the dev tools installed ?
>
> Fred

Yes. I reinstalled them just to be sure. The error persists.

Frederick Cheung

unread,
Jan 24, 2009, 2:45:40 PM1/24/09
to rubyonra...@googlegroups.com, rubyonra...@googlegroups.com
Ah, I know what's up. Try installing sqlite3-ruby instead (you were
trying to install the gem for sqlite 2)

Sent from my iPhone

On 24 Jan 2009, at 18:36, Adam Morris <rails-mailing-list@andreas-

Rick

unread,
Jan 24, 2009, 3:05:43 PM1/24/09
to Ruby on Rails: Talk
Just a guess here but...

I notice that your install target directory is /usr/local/... while
"which sqlite3" points at /usr/bin. I'm suspecting that the path to
the library is not set right in your environment - you need to be able
to find the sqlite includes and libraries during the install. Not
sure what's the simplest way to do this but here's what works for me.

I use /opt/local/... for my personal install root as OSX upgrades
overwrite the /usr/local directory. I built (ppc pre-built not
available) and installed my own copy of sqlite3 in /opt/local/bin and
have /opt/local/bin at the front of my search path. I'm running OSX
10.5.6, here are my RoR specs:

Ruby version 1.8.7 (powerpc-darwin9)
RubyGems version 1.3.1
Rails version 2.2.2
Active Record version 2.2.2
Action Pack version 2.2.2
Active Resource version 2.2.2
Action Mailer version 2.2.2
Active Support version 2.2.2
Application root /Users/rick/sqlite-test
Environment development
Database adapter sqlite3

Hope this helps...

Rick


On Jan 24, 8:12 am, Adam Morris <rails-mailing-l...@andreas-s.net>
wrote:

Adam Morris

unread,
Jan 24, 2009, 3:53:46 PM1/24/09
to rubyonra...@googlegroups.com
Frederick Cheung wrote:
> Ah, I know what's up. Try installing sqlite3-ruby instead (you were
> trying to install the gem for sqlite 2)
>
> Sent from my iPhone
>
> On 24 Jan 2009, at 18:36, Adam Morris <rails-mailing-list@andreas-

Well, that's mildly embarrassing. ;)

Thank you. Works now.

Reply all
Reply to author
Forward
0 new messages