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

Michael Bukowski
Michael Bukowski
12,870 Points

Bundle Issue with odot

I'm currently on the "Set up Git and add Gems" section in the odot module. I'm using a Mac OS X.

When I try to 'Bundle' in the command line I get: "An error occurred while installing nokogiri (1.6.2.1), and Bundler cannot continue. Make sure that gem install nokogiri -v '1.6.2.1' succeeds before bundling."

When I try to gem install nokogiri -v '1.6.2.1' I get: "Building nokogiri using system libraries. ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension.

/Users/myusername/.rbenv/versions/2.1.2/bin/ruby extconf.rb

Building nokogiri using system libraries. libxml2 version 2.6.21 or later is required! *** 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."

When I try to run "bin/rails generate rspec:install" I get: "Could not find gem 'capybara (~> 2.1.0) ruby' in the gems available on this machine."

Does anyone know what the issue is?

5 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

You seem to have an issue with xcode-select. Try running this and then try everything again:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
Michael Bukowski
Michael Bukowski
12,870 Points

Jason,

You were right! Thanks so much for the help!

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Do you have homebrew installed? If so, try running brew install libxml2 and then install nokogiri again.

Michael Bukowski
Michael Bukowski
12,870 Points

Jason,

Thanks for the response. Below is what happened:

"Michaels-MacBook-Air:odot michaelbukowski$ brew install libxml2 xcrun: error: active developer path ("/Applications/Git Application/Xcode.app/Contents/Developer") does not exist, use xcode-select to change Warning: libxml2-2.9.1 already installed"

Lonnie Parker
Lonnie Parker
5,964 Points

Hi Jason,

I'm on a 64-bit Windows 7 machine and I'm running the VM using Cmder and currently stuck at the Relationship video, trying to run "bundle" after adding the shoulda-machers gem. I'm getting a similar error as Michael after following the instructions to install nokogiri -v '1.6.0'.

ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension.

A newer, what looks to be a 64-bit, version of nokogiri is also available to be installed, but even after trying both versions, the error is the same. The command you recommended to Michael doesn't work as "sudo" isn't recognized by Cmder. The error message also recommends installing missing dependency libxml2, but again, I'm new to Cmder, so I wasn't sure what the analogous command to sudo apt-get install was to address this, even after checking online. Is there another way for me to resolve this issue? Thanks!

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Lonnie Parker can you create a new thread with a screenshot or paste of your error and tag me? That will make it easier for other people to find if they're having the same error :)