I spent hours trying to get sqlite3-ruby installed on Solaris 10 and finally figured it out. I use packages from Blastwave which is a nice package repository with a cool pkgutil command that automates pkg installation and resolves dependancies over the internet. Most of the time was wasted trying to get the gem installed using gcc, but a lot of gems have problems with gcc. The solution was to install Sun Studio 12.
1. Download and install from Sun Studio 12.
2. Setup Blastwave.
pkgadd -d http://blastwave.network.com/csw/pkgutil_`/sbin/uname -p`.pkg export PATH=/opt/csw/gnu:$PATH:/opt/csw/bin:/opt/SUNWspro/bin
3. Install ruby, sqlite3 and misc packages.
pkgutil -i ruby rubygems sqlite3 sqlite3dev binutils gnulinks
4. Install the sqlite3-ruby gem.
gem install sqlite3-ruby
What exactly is suppose to be changed in ext/sqlite3_api/extconf.rb
Posted by: connerton | April 27, 2009 at 03:49 PM
In step 5, I did a diff of my changed file and the original. You should change this line:
dir_config( "sqlite3", "/usr/local" )
to
dir_config( "sqlite3", "/opt/csw" )
Posted by: Richard | April 30, 2009 at 03:11 PM
I spent several hours trying to install sqlite3-ruby in Solaris 10 until I happened this blog post. Thanks for the post!
However, when I get to the point of actually installing the gem, I get the following error:
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby-1.2.4.gem:
ERROR: Failed to build gem native extension.
/opt/csw/bin/ruby extconf.rb
checking for fdatasync() in -lrt... no
checking for sqlite3.h... yes
checking for sqlite3_open() in -lsqlite3... no
make
make: Fatal error: Don't know how to make target `ruby.h'
Gem files will remain installed in /opt/csw/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection.
Results logged to /opt/csw/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out
Any ideas?
Posted by: Patrick | May 07, 2009 at 10:02 AM
Patrick,
I went back over my instructions and they seem all messed up. I brought up a clean zone and figured out what was missing, Sun Studio compiler. GCC doesn't work so well. Here's what I did:
download and install Sun Studio from http://developers.sun.com/sunstudio/downloads
pkgadd -d http://blastwave.network.com/csw/pkgutil_`/sbin/uname -p`.pkg
export PATH=$PATH:/opt/csw/bin:/opt/SUNWspro/bin
pkgutil -i ruby rubygems sqlite3 sqlite3dev binutils
ln -s /opt/csw/bin/gmake /opt/csw/bin/make
ln -s /opt/csw/bin/gld /opt/csw/bin/ld
gem install sqlite3-ruby
I will update the blog post. Let me know if this works out for you.
Richard
Posted by: Richard | May 07, 2009 at 12:34 PM
opencsw has a more up to date sqlite3 package than blastwave.
Same basic proceedure, and you can choose to use either pkg-get, or pkgutil with it.
You can upgrade to use opencsw packages, by just changing your pkgutil configuration to use the tree under
http://www.ibiblio.org/pub/packages/solaris/opencsw
(or one of the other mirror sites)
For someone starting from scratch, you could start by doing
pkgadd -d http://www.opencsw.org/pkg_get.pkg
pkg-get -i ruby rubygems sqlite3 sqlite3dev binutils gnulinks
and then putting /opt/csw/gnu in front of /opt/csw/bin in your $PATH. no need to manually make those symlinks yourself.
Posted by: Phil | May 12, 2009 at 11:27 AM
Phil,
Thanks for letting me know about opencsw and the gnulinks package. I remember when the blastwave mirrors stopped working, but didn't know why. Nice history page at http://www.opencsw.org/history about what happened.
Richard
Posted by: Richard | May 12, 2009 at 01:23 PM
I have an odd situation. Running Sol 10.
No matter what I do I cannot get sqlite3.h
to show up (always checking for sqlite3.h ... no)
It's in /opt/csw/lib. I can see it! Is it simply because running the gem install overwrites the extconf.rb file, and therefore the path gets buggered up? I've tried the newest sqlite3-ruby version 1.2.5, which doesn't have "/usr/local", same result.
Thoughts?
gem install sqlite3-ruby --version=1.2.3
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
/opt/csw/bin/ruby extconf.rb
checking for fdatasync() in -lrt... no
checking for sqlite3.h... no
Posted by: Troy | August 18, 2009 at 09:16 AM