[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

sqlite-ruby gem not building extension

Jim Freeze

5/12/2005 3:44:00 PM

Hi all

I am having troubles building the sqlite-ruby gem.
I don't think it is a gem problem, but a extconfig issue.

% gem install sqlite-ruby -v 2.2.3
Attempting local installation of 'sqlite-ruby'
Local gem file not found: sqlite-ruby*.gem
Attempting remote installation of 'sqlite-ruby'
Select which gem to install for your platform (powerpc-darwin7.7.0)
1. sqlite-ruby 2.2.3 (mswin32)
2. sqlite-ruby 2.2.3 (ruby)
3. Cancel installation
> 2
Building native extensions. This could take a while...
ERROR: While executing gem ... (RuntimeError)
ERROR: Failed to build gem native extension.
Gem files will remain installed in
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3 for
inspection.
ruby extconf.rb install sqlite-ruby -v 2.2.3\nchecking for main() in
-lsqlite... no
checking for sqlite.h... no


Results logged to
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3/ext/gem_make.out

For some reason, it is not finding my sqlite library and include file.
I have them, and I have even set environment variables to locate them:

% env | grep -i flag
CFLAGS=-I/Users/jdf/local/include
LDFLAGS=-L/Users/jdf/local/lib

% ls /Users/jdf/local/include/
sqlite.h
% ls /Users/jdf/local/lib
libsqlite.0.8.6.dylib libsqlite.a libsqlite.la
libsqlite.0.dylib libsqlite.dylib pkgconfig

The following should work, but does not:

% cd /Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3/ext
% ruby extconf.rb
checking for main() in -lsqlite... no
checking for sqlite.h... no

Are there some tricks to get extconf to find my lib and include files?

--
Jim Freeze
Ruby: I can explain it to ya but I can't understand it fer ya.


6 Answers

Ara.T.Howard

5/12/2005 4:14:00 PM

0

Jim Freeze

5/12/2005 6:43:00 PM

0

* Ara.T.Howard@noaa.gov <Ara.T.Howard@noaa.gov> [2005-05-13 01:35:28 +0900]:

> On Fri, 13 May 2005, Jim Freeze wrote:

> > % cd
> > /Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3/ext
> > % ruby extconf.rb
> > checking for main() in -lsqlite... no
> > checking for sqlite.h... no
> >
> >Are there some tricks to get extconf to find my lib and include files?
>
> --with-sqlite-dir=/Users/jdf/local

Wow, thanks.

% ruby extconf.rb --with-sqlite-dir=/Users/jdf/local
checking for main() in -lsqlite... yes
checking for sqlite.h... yes
checking for sqlite_open() in -lsqlite... yes
creating Makefile

How do I get rubygems to do this? Chad, Jim, anyone??

--
Jim Freeze
Ruby: I can explain it to ya but I can't understand it fer ya.


Chad Fowler

5/12/2005 7:22:00 PM

0

On 5/12/05, Jim Freeze <jim@freeze.org> wrote:
> * Ara.T.Howard@noaa.gov <Ara.T.Howard@noaa.gov> [2005-05-13 01:35:28 +0900]:
>
> > On Fri, 13 May 2005, Jim Freeze wrote:
>
> > > % cd
> > > /Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/gems/1.8/gems/sqlite-ruby-22.3/ext
> > > % ruby extconf.rb
> > > checking for main() in -lsqlite... no
> > > checking for sqlite.h... no
> > >
> > >Are there some tricks to get extconf to find my lib and include files?
> >
> > --with-sqlite-dir=/Users/jdf/local
>
> Wow, thanks.
>
> % ruby extconf.rb --with-sqlite-dir=/Users/jdf/local
> checking for main() in -lsqlite... yes
> checking for sqlite.h... yes
> checking for sqlite_open() in -lsqlite... yes
> creating Makefile
>
> How do I get rubygems to do this? Chad, Jim, anyone??
>
> --
> Jim Freeze
> Ruby: I can explain it to ya but I can't understand it fer ya.
>
>

gem install sqlite-ruby -v 2.2.3 -- --with-sqlite-dir=/Users/jdf/local

Uses the double dash separate similar to the old startx script with X.

--

Chad Fowler
http://chad...
http://rubyc...
http://ruby...
http://rubygems.rub... (over 300,000 gems served!)


Ara.T.Howard

5/12/2005 8:08:00 PM

0

Jaypee

5/13/2005 8:08:00 AM

0

Jim Freeze a écrit :
> Hi all
>
> I am having troubles building the sqlite-ruby gem.
> I don't think it is a gem problem, but a extconfig issue.
>
> % gem install sqlite-ruby -v 2.2.3
....
On a parallel note, be aware that many people having tried to use
SQLite3 with RoR have at some point given up.
After a good start, I had an issue with the usage of quotes around
columns name. Sometimes they were OK, sometimes they seemed missing.
I met that issue when I started using a Table.find_by_column call but
couldn't make it work. The same code worked like a treat with MySQL,
which unfortunately was over-dimensioned for my little hack (where
SQLite would have been perfect).
Before using such constructs, the adapter behaved as expected. So your
mileage may vary ...
J-P

Chad Fowler

5/13/2005 11:19:00 AM

0

On 5/12/05, Ara.T.Howard@noaa.gov <Ara.T.Howard@noaa.gov> wrote:
> On Fri, 13 May 2005, Chad Fowler wrote:
>
> > gem install sqlite-ruby -v 2.2.3 -- --with-sqlite-dir=3D/Users/jdf/local
> >
> > Uses the double dash separate similar to the old startx script with X.
>
> thank you for that hint! has the gem team thought about rescuing unknown opts
> and just putting them back into the command line?
>
> eg:
>
> begin
> op.parse! ARGV
> rescue OptionParser::InvalidOption => e
> # preverve unknown options
> e.recover ARGV
> end
>
> and then you could
>
> gem install sqlite-ruby -v 2.2.3 --with-sqlite-dir=3D/Users/jdf/local
>
> ??
>

Cool idea! Thanks!

--

Chad Fowler
http://chad...
http://rubyc...
http://ruby...
http://rubygems.rub... (over 300,000 gems served!)