Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Installing a Ruby Development Environment Installing a Ruby Development Environment Installing Ruby on Windows

Ed Fernandez
Ed Fernandez
13,245 Points

Get this browser error at the last step: Could not load 'active_record/connection_adapters/sqlite3_adapter'. Make sure t

So, when installing sqlite3 on a Windows 7 workstation, you get an error that sqlite3 can't load.

The fix to this is (per StackOverflow):

Find your sqlite3 gemspec file. One example is /usr/local/share/gem/specifications/sqlite3-1.3.7.gemspec or 'C:\Ruby21\lib\ruby\gems\2.1.0\specifications'. You should adjust according with your Rubygem path and sqlite3 version. Edit the file above and look for the following line


change it to

s.require_paths= ["lib/sqlite3_native"]

So, the above fixed the 1st problem. Now, the rails server will start, but when accessing the localhost:3000 on the browser, this error appears:

Could not load 'active_record/connection_adapters/sqlite3_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql', 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile.

Here are the contents of my Gemfile: source 'https://rubygems.org'

Bundle edge Rails instead: gem 'rails', github: 'rails/rails'

gem 'rails', '4.1.6'

Use sqlite3 as the database for Active Record

gem 'sqlite3'

Use SCSS for stylesheets

gem 'sass-rails', '~> 4.0.3'

Use Uglifier as compressor for JavaScript assets

gem 'uglifier', '>= 1.3.0'

Use CoffeeScript for .js.coffee assets and views

gem 'coffee-rails', '~> 4.0.0'

See https://github.com/sstephenson/execjs#readme for more supported runtimes

gem 'therubyracer', platforms: :ruby

Use jquery as the JavaScript library

gem 'jquery-rails'

Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks

gem 'turbolinks'

Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder

gem 'jbuilder', '~> 2.0'

bundle exec rake doc:rails generates the API under doc/api.

gem 'sdoc', '~> 0.4.0', group: :doc

Use ActiveModel has_secure_password

gem 'bcrypt', '~> 3.1.7'

Use unicorn as the app server

gem 'unicorn'

Use Capistrano for deployment

gem 'capistrano-rails', group: :development

Use debugger

gem 'debugger', group: [:development, :test]

Windows does not include zoneinfo files, so bundle the tzinfo-data gem

gem 'tzinfo-data', platforms: [:mingw, :mswin]

What does your Gemfile look like? I would need more info to know if I can help you.

3 Answers

Ed Fernandez
Ed Fernandez
13,245 Points

Ok, after a retarded number of hours troubleshooting this issue, I found my own answer and the simple answer is, in order for this testapp to work on a Windows 7 machine, you MUST INSTALL RUBY 2.0

(Apparently, there are multiple bugs to deal with if you install the latest ruby 2.1.x windows install.)

Indeed, if you install ruby 2.0 (not 2.1.x), then the commands listed on the lesson page WILL work (with one correction - the original statement "gem install sqlite" should be "gem install sqlite3"):

To summarize the steps:

(install ruby 2.0.x from rubyinstaller.org and install the corresponding devkit) (install node.js from nodejs.org) (install git - if desired)

Open a cmd/dos window and change directories until you are within your devkit install folder, and run these commands:

ruby dk.rb init ruby dk.rb install

Then install the gems with these commands: gem install bundler gem install sqlite3 gem install rails --version=4.0.2

Within the same command window, and in order to follow the lesson example, change directories until you are in your "my documents" folder and run this command:

rails new testapp

Then, move into the newly created "testapp" folder:

cd testapp

Next, use this command to start the server:

bundle exec rails server

Finally, opening this URL on your browser should actually work:


I hope this helps someone...

Ed, thank you so much! It helped me :) I started to install Ruby 2.1.3 and received an error when trying to install the sqlite3 gem. I uninstalled 2.1.3 and reinstalled 2.0.0-p576 instead and sqlite3 installed no problem!

Ed, Thanks a bunch. Solved my problem. I spent 2 days making sqlite3 and ruby 2.1 on W7. Treehouse, can u add this info to lecture notes please?