SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2006
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simply Rails 2 Problem - Installing SQLite Database Interface For Ruby

    OK after initially not being able to get Rails installed after following the instructions in the book I came on this forum and asked for help, I was told to install Xcode (even though in the book it presumes you can bypass this step). That worked and I was able to install Rails and SQLite, however when I get to the stage where I need to intstall the "SQLite Database Interface for Ruby' it tell me to enter this command line

    Code:
    $ sudo gem install sqlite3-ruby
    I do but instead of it installing I get presented with this error message

    Code:
    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
    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-opt-dir
    	--with-opt-include
    	--without-opt-include=${opt-dir}/include
    	--with-opt-lib
    	--without-opt-lib=${opt-dir}/lib
    	--with-make-prog
    	--without-make-prog
    	--srcdir=.
    	--curdir
    	--ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
    	--with-sqlite3-dir
    	--without-sqlite3-dir
    	--with-sqlite3-include
    	--without-sqlite3-include=${sqlite3-dir}/include
    	--with-sqlite3-lib
    	--without-sqlite3-lib=${sqlite3-dir}/lib
    	--with-rtlib
    	--without-rtlib
    	--with-sqlite3lib
    	--without-sqlite3lib
    
    
    Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.2 for inspection.
    Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.2/ext/sqlite3_api/gem_make.out
    Dans-MacBook-Pro-2:sqlite-3.5.4 Dan$
    What's going wrong? It suggest in the book that this is a tiny module and an easy installation from a single command. Yet for me it doesn't work.

    Any help would be much appreciated.

  2. #2
    SitePoint Enthusiast
    Join Date
    Dec 2006
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok I found this post on it

    http://www.sitepoint.com/forums/showthread.php?t=552741

    and used this code to re-install it

    Code:
    sudo gem install sqlite3-ruby -- --with-sqlite3-dir=/usr/local/bin
    and then the line of code to install the SQLite database interface for ruby again

    Code:
    $ sudo gem install sqlite3-ruby
    and it seems to have worked this time, i.e. as per example in the book and no error messages

    Hope this helps someone else

    Cheers

  3. #3
    SitePoint Zealot MystaMax's Avatar
    Join Date
    Apr 2003
    Location
    Atlanta
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had the same problem on ubuntu 8.04. I installed the libsqlite3-dev deb, and it works now. The SQLite3 development files are needed to install the gem

    On ubuntu thats:

    Code:
    sudo aptitude install libsqlite3-dev


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •