Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby

Ruby Track, Can't install SQLITE3 on Win8.1

I have started the Ruby track and have begun installing the development environment on Windows 8.1. Ruby installed fine, but SQLITE and bundler gave me issues. Bundler is installed now but this is my error log when installing SQLITE3.

C:\Users\Jon>gem install sqlite3 Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing sqlite3: ERROR: Failed to build gem native extension.

C:/Ruby21-x64/bin/ruby.exe extconf.rb

checking for sqlite3.h... no sqlite3.h is missing. Install SQLite3 from http://www.sqlite.org/ first. *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=C:/Ruby21-x64/bin/ruby --with-sqlite3-dir --without-sqlite3-dir --with-sqlite3-include --without-sqlite3-include=${sqlite3-dir}/include --with-sqlite3-lib --without-sqlite3-lib=${sqlite3-dir}/lib

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sqlite 3-1.3.10 for inspection. Results logged to C:/Ruby21-x64/lib/ruby/gems/2.1.0/extensions/x64-mingw32/2.1.0 /sqlite3-1.3.10/gem_make.out

C:\Users\Jon>

I followed the steps of another member solving this problem but unfortunately it did not work. Here are his instructions:

Jason Goebel 4,140 about 2 months ago

That is how I fixed the stipulation.

1: Go to: www.sqlite.org/download.html

2: Download sqlite-shell-win32-x86-3080701.zip and the sqlite-dll-win32-x86-3080701.zip files under Precompiled Binaries for Windows. (versions may differ)

3: Extract both the files into the Ruby[ver]/bin directory. Ex. c:\Ruby21-x64\bin\

4: Now try again: gem install sqlite3

That should work.

OS: Windows 8.1

After completing the second extractions I still get this error. Not sure what I should do here as I have downloaded the files from www.sqlite.org.

If anyone can help me get this working it would be much appreciated.

Thanks.

2 Answers

Michael Alaev
Michael Alaev
5,415 Points

Windows and Ruby are not the best friends, You better install Virtual Box and run it from unix base system.

Hi there Michael. Thank you for your response. I do have a Ubuntu partition on this computer. So I guess it is better for me to try in there?

Maciej Czuchnowski
Maciej Czuchnowski
36,440 Points

Yes, developing Ruby and Rails apps under Windows is always a bad idea and the Internet has less info about how to handle errors under Windows (since most developers use Unix-based systems). I personally use Ubuntu and it's flawless.

Maciej Czuchnowski having a few issues with my ubuntu partition by the looks of it. Will I be ok to use the treehouse VM ?

Maciej Czuchnowski
Maciej Czuchnowski
36,440 Points

I don't know how the treehouse vm works. The first VM I set up for myself was Ubuntu 13.04 using VMWare Player and I still use it sometimes when I'm on my Windows computer and it's great. You can also set up an online environment using Cloud9 or Nitrous. Hartl explains the setup in his book:

https://www.railstutorial.org/book/beginning#sec-up_and_running

(note however that he uses his dedicated Rails Tutorial option; you can use that as well or the pure Rails setup that Cloud9 provides; if anything goes wrong, just make another one :) )

It's cool because you can start working right away, you have a full editor, console and space for your app. It's like an Ubuntu in your browser, so you can work from ANY computer, you just log in.

I'm no big fan of Windows, but it's what I'm using right now (also 8.1). I also couldn't get it working using the files from http://www.sqlite.org. Short of setting up a VM, I was able to do:

$ gem install sqlite3-ruby

Which, in turn, seems to have installed sqlite3. I should point out that I was doing quite a few other things at the time, but I think that was the fix.

Matthew Thompson
Matthew Thompson
4,500 Points

Im not sure what difference the -ruby made at the end but this has worked for me. Thanks

Worked for me too! One of the interesting outputs from running that command was "The sqlite3-ruby gem has changed its name to just sqlite3. Rather than installing sqlite3-ruby, you should install sqlite3." Though, if I get more serious in Ruby/Rails development, then I might just use a Unix environment instead.

The sqlite3-ruby-1.3.3 directory is almost empty, it doesn't even have a Gemfile. The Rakefile has a line: extra-deps << ['sqlite3', '>= 1.3.3'], then it (may) cheerfully print out the message saying you should install sqlite3 instead. (Rakefile is like a Makefile for rake.) What's really odd is that there is a full sqlite3-ruby project and an active, current google group. You can check it out in the README.rdoc.