# “Add 'gem sqlite3'' to your Gemfile”

**URL:** <https://www.ruby-forum.com/t/add-gem-sqlite3-to-your-gemfile/235538>\
**Category:** Rails\
**Created:** [June 27, 2013, 10:31pm UTC](https://www.ruby-forum.com/t/add-gem-sqlite3-to-your-gemfile/235538 "2013-06-27T22:31:23Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [June 27, 2013, 10:31pm UTC](https://www.ruby-forum.com/t/add-gem-sqlite3-to-your-gemfile/235538/1 "2013-06-27T22:31:23Z")

</div>

Hello World!

I’m a complete n00b on Rails with only beginner knowledge of Ruby. I  
plan on studying Ruby more before I really learn Rails, but I’m waayy  
too curious for my own good.

Anyway, I was following the tutorial, but I got stuck when it said to  
type “rails server” in the blog directory. It states, “Specified  
‘sqlite3’ for database adapter, but the gem is not loaded. Add gem  
‘sqlite3’ to your Gemfile.” So I quit the server, installed sqlite3,  
reinstated the server…only to get this message again. sqlite3 doesn’t  
show up when I do “gem list”, but I do see the folder in my Root Ruby  
directory.

If it helps, I got Ruby 2.0, Rails 4.0, sqlite3 1.3.7

I apologize if this was answered already somewhere else, but I couldn’t  
find anything in the vast database that is stackoverflow. I would  
appreciate any patience that you are willing to provide.

Thank you very much! hewhocomes

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [June 27, 2013, 10:43pm UTC](https://www.ruby-forum.com/t/add-gem-sqlite3-to-your-gemfile/235538/2 "2013-06-27T22:43:07Z")

</div>

On 27 June 2013 21:31, Matt H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello World!
> 
> I’m a complete n00b on Rails with only beginner knowledge of Ruby. I  
> plan on studying Ruby more before I really learn Rails, but I’m waayy  
> too curious for my own good.
> 
> Anyway, I was following the tutorial,

Which tutorial and what Operating System are you using (Windows 7,  
Ubuntu etc)?

> but I got stuck when it said to  
> type “rails server” in the blog directory. It states, “Specified  
> ‘sqlite3’ for database adapter, but the gem is not loaded. Add gem  
> ‘sqlite3’ to your Gemfile.” So I quit the server, installed sqlite3,

It did not say to install sqlite3 (though this may be necessary) it  
said to add it to Gemfile. In fact you may just have to uncomment it  
in Gemfile. You should then run bundle install which should install  
the gem. I am surprised the tutorial did not cover this, assuming  
that it is a Rails 4 tutorial.

Colin

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [June 27, 2013, 10:54pm UTC](https://www.ruby-forum.com/t/add-gem-sqlite3-to-your-gemfile/235538/3 "2013-06-27T22:54:11Z")

</div>

Hi Colin,

Thank you for your quick reply!

I am using Windows 7. Ruby works fine as I’ve been using cmd prompt and  
irb to experiment with Ruby. The tutorial is “Getting Started with  
Rails” ([Getting Started with Rails — Ruby on Rails Guides](http://guides.rubyonrails.org/getting_started.html)). I got stuck  
at the beginning of 4. Hello, Rails!.

When I initially tried to install rails, it failed and asked me to  
download the DevKit. I followed all the instructions on that correctly.  
Then I tried installing rails again and it had a bunch of “could not  
convert ASCII-8BIT to UTF-8” and skipped those files. It wasn’t until I  
got stuck with this error (see post above) that I installed sqlite3.  
When I installed sqlite3, it said something about being added to Gemfile  
list (if I remember right). I still don’t see it when I do gem list.

I did discover sqlite3 in Gemfile.lock and the text: “# Use sqlite3 as  
the database for Active Record  
gem ‘sqlite3’” in Gemfile in the root directory of the blog the tutorial  
asked me to make.

Thanks once again!

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [June 27, 2013, 11:14pm UTC](https://www.ruby-forum.com/t/add-gem-sqlite3-to-your-gemfile/235538/4 "2013-06-27T23:14:39Z")

</div>

On 27 June 2013 21:54, Matt H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi Colin,
> 
> Thank you for your quick reply!
> 
> I am using Windows 7.

Most RoR developers use Linux (eg Ubuntu) or Mac. I believe it is  
possible to use Windows but you will find it more difficult to get  
support as so few use it. I advise using Ubuntu either by dual  
booting the PC or running it in a virtual machine.

I usually recommend [railstutorial.org](http://railstutorial.org) for beginners.

> When I installed sqlite3, it said something about being added to Gemfile  
> list (if I remember right). I still don’t see it when I do gem list.

I suspect the encoding issues are Windows problems.

> I did discover sqlite3 in Gemfile.lock and the text: “# Use sqlite3 as  
> the database for Active Record  
> gem ‘sqlite3’” in Gemfile in the root directory of the blog the tutorial  
> asked me to make.

I don’t quite understand what you are saying above. You should not  
edit Gemfile.lock, you should edit Gemfile. Then run  
bundle install  
in a terminal. That should install the gem and update Gemfile.lock.  
However, since you are using Windows, I don’t know whether there are  
other issues.

Colin

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [June 27, 2013, 11:58pm UTC](https://www.ruby-forum.com/t/add-gem-sqlite3-to-your-gemfile/235538/5 "2013-06-27T23:58:28Z")

</div>

On Jun 27, 2013, at 3:12 PM, Colin L. wrote:

> I suspect the encoding issues are Windows problems.

Installing on OSX gives a batch of encoding errors as well. They’re all  
rdoc-related, and I’ve always just ignored them, but they’d be  
concerning to a newbie–especially one who’s having trouble getting  
started 😉

–  
Scott R.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> **[Elevated Software Development, Inc.](http://www.elevated-dev.com/)**

(303) 722-0567 voice

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [June 28, 2013, 5:32am UTC](https://www.ruby-forum.com/t/add-gem-sqlite3-to-your-gemfile/235538/6 "2013-06-28T05:32:12Z")

</div>

On Jun 27, 2013, at 4:53 PM, Matt H. wrote:

> If  
> those who made it say it works on Windows, it works on Windows.

It does work on Windows, but very few people use it on Windows, so very  
few people will be able to help you with Windows-specific questions.

Although, once you get started, that won’t matter nearly as much.

–  
Scott R.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> **[Elevated Software Development, Inc.](http://www.elevated-dev.com/)**

(303) 722-0567 voice

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [June 28, 2013, 12:53am UTC](https://www.ruby-forum.com/t/add-gem-sqlite3-to-your-gemfile/235538/7 "2013-06-28T00:53:20Z")

</div>

Hi guys,

Thanks again for the replies. I did a bundle install. When I did the  
command, “bundle show sqlite3”, it replies with, “Could not find gem  
‘sqlite3’. Did you mean sqlite3?”

What I meant earlier is the following:

Gemfile has the following text:

# Use sqlite3 as the database for Active Recordgem ‘sqlite3’

I only have Notepad to view this information, so it just looks like a  
long line of text.

Gemfile.lock has the following text:  
sqlite3 (1.3.7-x86-mingw32)

I also the following text in Gemfile.lock:  
sqlite3

This files already had this text here without me doing anything.

It would be my preference to not have to learn an entire OS just because  
I want to be able to program. I understand that people have strong  
preferences and that if I understand more of what I’m doing and how  
computers work, then I too may develop said preferences. Right now, I  
just want to play with Rails and Ruby. That’s all…nothing fancy. If  
those who made it say it works on Windows, it works on Windows.

If this error really is an rDoc issue…I’ve already updated rDoc and I  
still have the same Gem::LoadError (Specified ‘sqlite3’ for database  
adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your  
Gemfile.)

Thanks again!

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [July 1, 2013, 7:10pm UTC](https://www.ruby-forum.com/t/add-gem-sqlite3-to-your-gemfile/235538/8 "2013-07-01T19:10:21Z")

</div>

It works! It works!

Thank you, Mr. Pearson. I was able to download your sqlite files and  
follow your instructions and it worked. I had trouble using the guide  
you linked. The directions were clear, but my environment didn’t like  
the filed it extracted because it couldn’t find the libversion\_number  
file. Your attachment worked, though! It’s a shame that [sqlite.com](http://sqlite.com)  
doesn’t provide these files.

Thank you very much for your clear instructions! I linked this topic on  
my question in stackoverflow to show other how it works on Windows.

> <https://stackoverflow.com/questions/17350837/ruby-on-rails-add-gem-sqlite3-to-your-gemfile/17409859#17409859>

Rails shows me the appropriate Welcome screen and everything! Thank you  
very much everyone, for giving this n00b advice and direction! I do feel  
like I understand how Ruby and Rails word on my system a little better.

Thank you!  
hewhocomes

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [June 30, 2013, 1:56pm UTC](https://www.ruby-forum.com/t/add-gem-sqlite3-to-your-gemfile/235538/9 "2013-06-30T13:56:22Z")

</div>

There’s a quick guide on how to install Sqlite3 on Windows 7 here:

[http://www.ruby-forum.com/topic/4413168](http://www.ruby-forum.com/topic/4413168)

I followed the instructions on there, and after a few minor tweaks, I  
managed to get it working.

I’ve tried to attach a zip with the necessary files in. Hopefully if you  
can download that you can drop it into a folder like c:/rails, making it  
c:/rails/sqlite, and then run this command:

gem install sqlite3 --platform=ruby –  
–with-sqlite3-include=c:/rails/sqlite/include  
–with-sqlite3-lib=c:/rails/sqlite/lib  
–with-sqlite3-dir=c:/rails/sqlite/bin

Sometimes running “bundle install” on a Rails project can install a  
conflicting version of the sqlite gem, so make sure you’ve only got 1  
version after using bundle.

It helps to put sqlite3.def and sqlite3.dll somewhere in your path, like  
in your Ruby bin folder.

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [July 1, 2013, 8:37pm UTC](https://www.ruby-forum.com/t/add-gem-sqlite3-to-your-gemfile/235538/10 "2013-07-01T20:37:49Z")

</div>

No problem, we’re here to help 🙂

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [July 22, 2013, 11:23pm UTC](https://www.ruby-forum.com/t/add-gem-sqlite3-to-your-gemfile/235538/11 "2013-07-22T23:23:50Z")

</div>

On Friday, 28 June 2013 02:53:20 UTC+4, [Ruby-Forum.com](http://Ruby-Forum.com) User wrote:

> Hi guys,
> 
> I only have Notepad to view this information, so it just looks like a  
> long line of text.
> 
> Gemfile.lock has the following text:  
> sqlite3 (1.3.7-x86-mingw32)

I had the same troulbe on Windows7-x64 even I made everything according  
to  
[https://www.ruby-forum.com/topic/4413168](https://www.ruby-forum.com/topic/4413168)  
Then I opened Gemfile.lock file and just edit this row to “sqlite3  
(1.3.7-x64-mingw32)” and run server again - it worked correct. Hope it  
will  
help somebody

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [August 20, 2013, 10:08pm UTC](https://www.ruby-forum.com/t/add-gem-sqlite3-to-your-gemfile/235538/12 "2013-08-20T22:08:15Z")

</div>

“Константин Медведев” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote in post #1116282:

> On Friday, 28 June 2013 02:53:20 UTC+4, [Ruby-Forum.com](http://Ruby-Forum.com) User wrote:
> 
> > Hi guys,
> > 
> > I only have Notepad to view this information, so it just looks like a  
> > long line of text.
> > 
> > Gemfile.lock has the following text:  
> > sqlite3 (1.3.7-x86-mingw32)
> 
> I had the same troulbe on Windows7-x64 even I made everything according  
> to  
> [SQLite3 Ruby 2.0 on Windows - Ruby - Ruby-Forum](https://www.ruby-forum.com/topic/4413168)  
> Then I opened Gemfile.lock file and just edit this row to “sqlite3  
> (1.3.7-x64-mingw32)” and run server again - it worked correct. Hope it  
> will  
> help somebody

That helped so much. I don’t know why it was insisting on using the x86  
version, which of course didn’t exist.
