1

When I go to install using "sudo bundle install" to install all of them...it throws an error on sqlite3:

 Installing sqlite3 (1.3.3) with native extensions /Library/Ruby/Site/1.8/rubygems/installer.rb:533:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

            /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb 
    mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


    Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.3 for inspection.
    Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.3/ext/sqlite3/gem_make.out
        from /Library/Ruby/Site/1.8/rubygems/installer.rb:486:in `each'
        from /Library/Ruby/Site/1.8/rubygems/installer.rb:486:in `build_extensions'
        from /Library/Ruby/Site/1.8/rubygems/installer.rb:159:in `install'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/source.rb:96:in `install'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/installer.rb:55:in `run'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/spec_set.rb:12:in `each'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/spec_set.rb:12:in `each'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/installer.rb:44:in `run'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/installer.rb:8:in `install'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/cli.rb:225:in `install'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/vendor/thor/task.rb:22:in `send'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/vendor/thor/task.rb:22:in `run'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/vendor/thor.rb:246:in `dispatch'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/vendor/thor/base.rb:389:in `start'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/bin/bundle:13
        from /usr/bin/bundle:19:in `load'
        from /usr/bin/bundle:19

Then I think maybe I have it already installed because i've used it before...but when I do "rake db:create" it gives me this:

Could not find gem 'sqlite3 (>= 0)' in any of the gem sources listed in your Gemfile.

What am I doing wrong?

Matthew Berman
  • 8,481
  • 10
  • 49
  • 98
  • what system? From your paths it looks like MacOS X. Have you installed the developer tools? – ghoppe Apr 27 '11 at 04:20

2 Answers2

3

Make sure you have XCode installed. The necessary header files should be installed by that.

Also, unrelated advice, stop using sudo. Look into installing RVM. It will make your life easier.

Related question: Snow Leopard & Ruby on Rails - SQLite3 issue

Community
  • 1
  • 1
ghoppe
  • 21,452
  • 3
  • 30
  • 21
  • Also worth checking out is [MacPorts](http://macports.org/) and [Homebrew](http://mxcl.github.com/homebrew/) to manage dependent libraries. – tadman Apr 27 '11 at 05:10
0

You may be missing the sqlite3.dll file. Go to the bin folder in your ruby folder and look for a sqlite3.dll file. If you can't find it there then download it for http://www.sqlite.org/download.html. Then put the dll file in your bin(ruby's bin) folder and run bundle install again and see if that works.