Leopard LoadError: no such file to load — sqlite3

I’m not quite sure why this happened, but I kept getting this error with Leopard and sqlite3:

LoadError: no such file to load -- sqlite3

I tried to gem install and uninstall sqlite3-ruby a few times but that didn’t work out. However, installing from source did. Head on over to the Rubyforge page and download the zip or tgz archive. Extract it and just run:

ruby setup.rb

After that requiring sqlite3 should work fine.

13 Responses to “Leopard LoadError: no such file to load — sqlite3”

  1. Nick November 24, 2008 at 4:58 pm #

    This was very helpful. Thank you very much.

  2. Jeremy Weiskotten November 25, 2008 at 1:30 am #

    Same thing happened to me today. Strange. Did you also update your Rails gems to 2.2.2?

  3. Jason Seifer November 25, 2008 at 1:57 am #

    @Nick Thanks!

    @Jeremy I did update the Rails gems but I’m not sure how long this has been broken.

  4. Ricardo Yasuda November 29, 2008 at 7:52 pm #

    Had this problem too, after updating the Rails gems to 2.2.2. Your solution worked perfectly, thanks!

  5. Marc Jeanson February 7, 2009 at 3:43 am #

    adding the following to my environment.rb fixed this same issue:

    config.gem ‘sqlite3-ruby’, :lib => ‘sqlite3’

    • Rizzz July 28, 2010 at 6:35 pm #

      Worked like a charm!

  6. Charlie February 26, 2009 at 10:31 pm #

    You post just keeps on giving. Thanks from me, as well.

  7. A October 27, 2010 at 3:37 am #

    If you tried to load sqlite3 (gems) by require ‘sqlite3′ in your source code, you need to put require ‘rubygems’ first – i mean above require ‘sqlite’…

    • bonbon February 5, 2012 at 9:49 pm #

      You are my hero right now.

    • t May 4, 2012 at 4:47 pm #

      You are my hero.

    • Michael May 16, 2012 at 3:01 pm #

      Helped me too, thanks!

  8. Shawn Lauzon December 26, 2010 at 1:13 am #

    Thanks, I was banging my head on the wall until I got this hint

Trackbacks/Pingbacks

  1. codevader » Blog Archive » Problems with Sqlite3 on Leopard? - June 12, 2009

    [...] I could open sqlite3 at the console just fine. Ruby didn’t see it though. The solution was here. Ditching the gem and compiling from source fixed [...]

Leave a Reply