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

Artful Wisdom
PLUS
Artful Wisdom
Courses Plus Student 6,506 Points

Error with gem install sqlite3

i get this when i try to install(i have windows) 位 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/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/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 --enable-local --disable-local

extconf failed, exit code 1

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

Ruby
Installing a Ruby...
Installing a Ruby...
Installing Ruby on Windows

1 Answer

Nikolay Batrakov
Nikolay Batrakov
9,604 Points

ERROR: Failed to build gem native extension. basically means that while installing a gem, ruby wasn't able to compile some C code nested inside that gem. You could see the details of process if you run gem install sqlite3 --verbose That could come either from environment improper set up or from missing or incorrect configuration flag you have to provide in order for the C compiler to work. I'm not a windows guy, when the issue pops up in Mac OS, it usually deals with xcode-select. Have you ever tried this kit?

On the other hand I would recommend you to build your own virtual machine with Virtual Box and Vagrant or choose VM that treehouse guys have already built for us. That gives you clean configuration of your project environment and spares you of these annoying compatibility issues.