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 Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Set up Git and Add Gems

When I type bundle half of these things don't show up

My gemfile looks exactly as shown and for some reason i cannot install capybara or rspec... this is the output i get when i run bundle.

DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/.........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.2.1)
Using i18n (0.6.9)
Using minitest (4.7.5)
Using multi_json (1.9.2)
Using atomic (1.1.16)
Using thread_safe (0.3.1)
Using tzinfo (0.3.39)
Using activesupport (4.0.4)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.4)
Using mime-types (1.25.1)
Using polyglot (0.3.4)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (4.0.4)
Using activemodel (4.0.4)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.2)
Using activerecord (4.0.4)
Using bundler (1.5.3)
Using mini_portile (0.5.3)

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    C:/Ruby200-x64/bin/ruby.exe extconf.rb
checking for libxml/parser.h... no
-----
libxml2 is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** 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:/Ruby200-x64/bin/ruby
        --with-zlib-dir
        --without-zlib-dir
        --with-zlib-include
        --without-zlib-include=${zlib-dir}/include
        --with-zlib-lib
        --without-zlib-lib=${zlib-dir}/lib
        --with-iconv-dir
        --without-iconv-dir
        --with-iconv-include
        --without-iconv-include=${iconv-dir}/include
        --with-iconv-lib
        --without-iconv-lib=${iconv-dir}/lib
        --with-xml2-dir
        --without-xml2-dir
        --with-xml2-include
        --without-xml2-include=${xml2-dir}/include
        --with-xml2-lib
        --without-xml2-lib=${xml2-dir}/lib
        --with-xslt-dir
        --without-xslt-dir
        --with-xslt-include
        --without-xslt-include=${xslt-dir}/include
        --with-xslt-lib
        --without-xslt-lib=${xslt-dir}/lib
        --with-libxslt-config
        --without-libxslt-config
        --with-pkg-config
        --without-pkg-config
        --with-libxml-2.0-config
        --without-libxml-2.0-config
        --with-pkg-config
        --without-pkg-config
        --with-libiconv-config
        --without-libiconv-config
        --with-pkg-config
        --without-pkg-config


Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.1 for inspection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.1/ext/nokogiri/gem_make.out
An error occurred while installing nokogiri (1.6.1), and Bundler cannot
continue.

3 Answers

You're missing the dependency libxml2, which nokogiri requires for installation. You need to install libxml2 through your OS - are you on Linux?

Hi, Michael. Nokogiri (the Gem that fails installing when running bundle) doesn't support 64-bit Ruby on Windows. The solution to this would be to remove the 64-bit version of Ruby and use the 32-bit version instead.

But shouldn't i be using the 64 bit version if i have a 64 bit machine?

Using a 64-bit version is desirable when you have one, but it is not a requirement. You can still run 32-bit software on a 64-bit Windows machine.

I understand that. So you're saying there's no way around this? I have to downgrade the software in order to use it, simply because I am developing on a windows machine?

I understand that. So you're saying there's no way around this? I have to downgrade the software in order to use it, simply because I am developing on a windows machine?

I wouldn't necessarily call that downgrading, but I understand your frustration. The thing is, while Rails development is possible on Windows, it was never really Windows-friendly. You'll find that you'll often have to take additional steps to ensure that all the gems are working properly, some gems will be incompatible with Windows and you'll have to look for equivalent ones that do work on Windows etc.

You might want to consider developing inside a virtual machine. Treehouse offers one along with a video tutorial to get you up and running: http://teamtreehouse.com/library/installing-a-ruby-development-environment