Getting sqlite3 to work on Tiger with Rails 2.1.0 4

Posted by scott on June 16, 2008

Two steps:
1. Install sqlite3 on your mac
2. Install the sqlite gem

Step 1:
On Mac OS X Leopard - no worries. It’s already installed and working great!

On Mac OS X Tiger - be careful. It is technically already installed, but you might have problems with migrations still.
If you are having problems, you need to do the following:
A. sudo gem uninstall sqlite3-ruby
B. run the following commands in your terminal command line

curl -O http://www.sqlite.org/sqlite-3.5.9.tar.gz
$ tar xzf sqlite-3.5.9.tar.gz
$ cd sqlite-3.5.9
$ ./configure --prefix=/usr/local
$ make
$ sudo make install

(Thanks to Accidental Technologist.)

Step 2:
run ’sudo gem install sqlite3-ruby’ in your terminal.

———-
Miscellaneous comments as I was trying to figure this out. These really are not all that useful.
RailsWiki instructions for sqlite3

HOWEVER, you might still get this error like I did. Also here.

Unfortunately, those forum links did not help.

Try this: “I had the above problem with Rails 2.0.2 and sqlite3 3.1.2, but the same procedure (compiling sqlite3 3.5.4 from source, removing the sqlite3-ruby gem, and reinstalling it) worked for me. I didn?t uninstall and reinstall all my gems, just sqlite3-ruby.?Ben Kimball”

And thank you mislav for instructions on how to get it going. Never mind. Not helpful to Tiger users.

Trackbacks

Trackbacks are closed.

Comments

Leave a response

  1. Lee Tue, 24 Jun 2008 18:29:15 UTC

    Thanks man. That was very helpful.

  2. Ian Piper Sat, 05 Jul 2008 10:48:40 UTC

    Thanks for the notes on this. I have also been having real problems in this area. I installed the whole ruby-gem-rails toolset and don’t seem to be able to get sqlite3 going. I installed v3.5.9 of sqlite3-ruby but still get this kind of message when doing a migration:

    morse:/Users/Shared/software/addressbook rubyrails$ rake db:migrate
    (in /Users/Shared/software/addressbook)
    rake aborted!
    no such file to load — sqlite3/database

    This is on a Mac OS X Server box btw. I think I may have to resort to MySQL.

  3. scott Sat, 05 Jul 2008 18:41:39 UTC

    Hi Ian. I’m not sure what could still be the problem. I’ve never dealt with OS X Server.

    Did you first uninstall the sqlite3-ruby gem via sudo gem uninstall sqlite3-ruby?

    Then after doing the curl, and make, and sudo make, did you then reinstall the sqlite3-ruby gem by doing sudo gem install sqlite3?

    What happens when you type ****sqlite3**** into your terminal?

  4. joel Thu, 10 Jul 2008 06:03:11 UTC

    Thanks alot, I kept looking for a binary install, but as always, its just easier to compile. DOH!!!

Comments