sqlite-ruby gem not building extension

J

Jim Freeze

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
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?
 
A

Ara.T.Howard

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
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?

--with-sqlite-dir=/Users/jdf/local

??

-a
--
===============================================================================
| email :: ara [dot] t [dot] howard [at] noaa [dot] gov
| phone :: 303.497.6469
| renunciation is not getting rid of the things of this world, but accepting
| that they pass away. --aitken roshi
===============================================================================
 
J

Jim Freeze

--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??
 
C

Chad Fowler

* (e-mail address removed) <[email protected]> [2005-05-13 01:35:28 +090= 0]:
=20


--with-sqlite-dir=3D/Users/jdf/local
=20
Wow, thanks.
=20
% ruby extconf.rb --with-sqlite-dir=3D/Users/jdf/local
checking for main() in -lsqlite... yes
checking for sqlite.h... yes
checking for sqlite_open() in -lsqlite... yes
creating Makefile
=20
How do I get rubygems to do this? Chad, Jim, anyone??
=20
--
Jim Freeze
Ruby: I can explain it to ya but I can't understand it fer ya.
=20
=20

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.

--=20

Chad Fowler
http://chadfowler.com
http://rubycentral.org=20
http://rubygarden.org=20
http://rubygems.rubyforge.org (over 300,000 gems served!)
 
A

Ara.T.Howard

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

??

-a
--
===============================================================================
| email :: ara [dot] t [dot] howard [at] noaa [dot] gov
| phone :: 303.497.6469
| renunciation is not getting rid of the things of this world, but accepting
| that they pass away. --aitken roshi
===============================================================================
 
J

Jaypee

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
 
C

Chad Fowler

On Fri, 13 May 2005, Chad Fowler wrote:
=20
=20
thank you for that hint! has the gem team thought about rescuing unknown= opts
and just putting them back into the command line?
=20
eg:
=20
begin
op.parse! ARGV
rescue OptionParser::InvalidOption =3D> e
# preverve unknown options
e.recover ARGV
end
=20
and then you could
=20
gem install sqlite-ruby -v 2.2.3 --with-sqlite-dir=3D3D/Users/jdf/loca= l
=20
??
=20

Cool idea! Thanks!

--=20

Chad Fowler
http://chadfowler.com
http://rubycentral.org=20
http://rubygarden.org=20
http://rubygems.rubyforge.org (over 300,000 gems served!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top