# Could not find sqlite3

**URL:** <https://discuss.rubyonrails.org/t/could-not-find-sqlite3/57985>\
**Category:** rubyonrails-talk\
**Created:** [March 18, 2011, 10:23pm UTC](https://discuss.rubyonrails.org/t/could-not-find-sqlite3/57985 "2011-03-18T22:23:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [March 18, 2011, 10:23pm UTC](https://discuss.rubyonrails.org/t/could-not-find-sqlite3/57985/1 "2011-03-18T22:23:49Z")

</div>

I am trying to get Ruby/Rails running on my mac but having some issues.

I created a new rails project "blog\_test" trying to get something working. When I follow this guide [Getting Started with Rails — Ruby on Rails Guides](http://guides.rubyonrails.org/getting_started.html) it says to do a "db:create". This is where I get this error...

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

If I do a 'which sqlite3' I get the following path /usr/bin/sqlite3.

Any help/suggestions would be appreciated.

Installed ---- Ruby 1.8.7 Rials 3.0.5

gem list

\*\*\* LOCAL GEMS \*\*\*

abstract (1.0.0) actionmailer (3.0.5, 2.3.5, 1.3.6) actionpack (3.0.5, 2.3.5, 1.13.6) actionwebservice (1.2.6) activemodel (3.0.5) activerecord (3.0.5, 2.3.5, 1.15.6) activeresource (3.0.5, 2.3.5) activesupport (3.0.5, 2.3.5, 1.4.4) acts\_as\_ferret (0.4.3) arel (2.0.9) builder (2.1.2) bundler (1.0.10) capistrano (2.5.2) cgi\_multipart\_eof\_fix (2.5.0) daemons (1.0.10) diff-lcs (1.1.2) dnssd (0.6.0) erubis (2.6.6) fastthread (1.0.1) fcgi (0.8.7) ferret (0.11.6) gem\_plugin (0.2.3) haml (3.1.0.alpha.147, 3.0.25) highline (1.5.0) hpricot (0.6.164) i18n (0.5.0) libxml-ruby (1.1.2) mail (2.2.15) mime-types (1.16) mongrel (1.1.5) needle (1.3.0) net-scp (1.0.1) net-sftp (2.0.1, 1.1.1) net-ssh (2.0.4, 1.1.4) net-ssh-gateway (1.0.0) polyglot (0.3.1) rack (1.2.2, 1.0.1) rack-flash (0.1.1) rack-mount (0.6.13) rack-test (0.5.7) rails (3.0.5, 2.3.5, 1.2.6) railties (3.0.5) rake (0.8.7, 0.8.3) RedCloth (4.1.1) rspec (2.5.0) rspec-core (2.5.1) rspec-expectations (2.5.0) rspec-mocks (2.5.0) ruby-openid (2.1.2) ruby-yadis (0.3.4) rubygems-update (1.6.2) rubynode (0.1.5) sequel (3.21.0) shotgun (0.9) sinatra (1.2.1) sinatra-sequel (0.9.0) sqlite3-ruby (1.2.4) termios (0.9.4) thor (0.14.6) tilt (1.2.2) treetop (1.4.9) tzinfo (0.3.25) xmpp4r (0.4)

---

<div class="post-metadata">

**Author:** ![radhames\_brito](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@radhames\_brito](https://discuss.rubyonrails.org/u/radhames_brito)\
**Post date:** [March 18, 2011, 10:39pm UTC](https://discuss.rubyonrails.org/t/could-not-find-sqlite3/57985/2 "2011-03-18T22:39:33Z")

</div>

type bundle install at the app root directory

if it does not works post you gemfile

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [March 18, 2011, 10:44pm UTC](https://discuss.rubyonrails.org/t/could-not-find-sqlite3/57985/3 "2011-03-18T22:44:27Z")

</div>

Carl Jenkins wrote in post #988231:

> I am trying to get Ruby/Rails running on my mac but having some issues.
> 
> I created a new rails project "blog\_test" trying to get something working. When I follow this guide [Getting Started with Rails — Ruby on Rails Guides](http://guides.rubyonrails.org/getting_started.html) it says to do a "db:create". This is where I get this error...
> 
> Could not find gem 'sqlite3 (\>= 0)' in any of the gem sources listed in your Gemfile.

> sqlite3-ruby (1.2.4) termios (0.9.4)

Maybe doing gem install sqlite3 fixes it?

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [March 18, 2011, 10:51pm UTC](https://discuss.rubyonrails.org/t/could-not-find-sqlite3/57985/4 "2011-03-18T22:51:24Z")

</div>

Kedar Mhaswade wrote in post #988237:

> Carl Jenkins wrote in post #988231:
> 
> > I am trying to get Ruby/Rails running on my mac but having some issues.
> > 
> > I created a new rails project "blog\_test" trying to get something working. When I follow this guide [Getting Started with Rails — Ruby on Rails Guides](http://guides.rubyonrails.org/getting_started.html) it says to do a "db:create". This is where I get this error...
> > 
> > Could not find gem 'sqlite3 (\>= 0)' in any of the gem sources listed in your Gemfile.
> 
> > sqlite3-ruby (1.2.4) termios (0.9.4)
> 
> Maybe doing gem install sqlite3 fixes it?

I did a gem install sqlite3 and got this....

Building native extensions. This could take a while... ERROR: Error installing sqlite3: &nbsp;&nbsp;ERROR: Failed to build gem native extension.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/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

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [March 18, 2011, 11:00pm UTC](https://discuss.rubyonrails.org/t/could-not-find-sqlite3/57985/5 "2011-03-18T23:00:57Z")

</div>

Kedar Mhaswade wrote in post #988237:

> Carl Jenkins wrote in post #988231:
> 
> > I am trying to get Ruby/Rails running on my mac but having some issues.
> > 
> > I created a new rails project "blog\_test" trying to get something working. When I follow this guide [Getting Started with Rails — Ruby on Rails Guides](http://guides.rubyonrails.org/getting_started.html) it says to do a "db:create". This is where I get this error...
> > 
> > Could not find gem 'sqlite3 (\>= 0)' in any of the gem sources listed in your Gemfile.
> 
> > sqlite3-ruby (1.2.4) termios (0.9.4)
> 
> Maybe doing gem install sqlite3 fixes it?

I tried what you mentioned and it didn't work. But, I am not sure what you mean by "post your gem file". Which file is this?

I got this....

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)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/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 &nbsp;&nbsp;from /Library/Ruby/Site/1.8/rubygems/installer.rb:486:in `each' &nbsp;&nbsp;from /Library/Ruby/Site/1.8/rubygems/installer.rb:486:in `build\_extensions' &nbsp;&nbsp;from /Library/Ruby/Site/1.8/rubygems/installer.rb:159:in `install' &nbsp;&nbsp;from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/source.rb:96:in `install' &nbsp;&nbsp;from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:55:in `run' &nbsp;&nbsp;from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each' &nbsp;&nbsp;from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/spec\_set.rb:12:in `each' &nbsp;&nbsp;from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:44:in `run' &nbsp;&nbsp;from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:8:in `install' &nbsp;&nbsp;from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/cli.rb

---

<div class="post-metadata">

**Author:** ![Bryan\_Crossland](https://avatars.discourse-cdn.com/v4/letter/b/6a8cbe/32.png) [@Bryan\_Crossland](https://discuss.rubyonrails.org/u/Bryan_Crossland)\
**Post date:** [March 19, 2011, 2:09pm UTC](https://discuss.rubyonrails.org/t/could-not-find-sqlite3/57985/6 "2011-03-19T14:09:59Z")

</div>

Did you try sudo gem install sqlite3?

B.

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [May 10, 2011, 10:32pm UTC](https://discuss.rubyonrails.org/t/could-not-find-sqlite3/57985/7 "2011-05-10T22:32:53Z")

</div>

I had this same problem right after install and

sudo gem install sqlite3

worked
