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

Error when adding gems

So I am trying to install the gems rspec and capybara in the Odot tutorial. After trying to do the bundle install in the terminal i get a error saying:

extconf failed, exit code 1

Gem files will remain installed in /Users/Jac/.rvm/gems/ruby-2.1.2/gems/nokogiri-1.6.3.1 for inspection. Results logged to /Users/Jac/.rvm/gems/ruby-2.1.2/extensions/x86_64-darwin-13/2.1.0-static/nokogiri-1.6.3.1/gem_make.out An error occurred while installing nokogiri (1.6.3.1), and Bundler cannot continue. Make sure that gem install nokogiri -v '1.6.3.1' succeeds before bundling.

In the beginning of this tutorial it was mentioned that if your running Rails 4.1 (which I am) you may have problems so I'm guessing this is one of those problems. Any help from anyone will be great! Thanks

4 Answers

Coincidentally I was going through this issue when you initially posted. Until now, I have not had a solution. (http://apple.stackexchange.com/questions/129280/nokogiri-gem-fails-to-install-in-os-x-mavericks) finally had my solution. Not an easy one. Seems to be common with clean installs of mavericks osx. Been trying to install vagrant on my home machine for quite some time now. Hope this helps you if you haven't already found a solution.

This actually solved my problem. I had to install a RVM to get the gem "nokogiri" to install. I'm guessing the version of ruby that comes straight out the box doesn't work with all gems. Lesson learned. Thanks for all your help!

Hi Jac,

I'm not sure if you're still having an issue with this, but I was able to get it to work by installing the new Xcode, which has an update for OS X

  1. First, enter the following command in the terminal: xcode-select --install

  2. Then a prompt will display, asking if you want to install the tools, so: click install

  3. Once the installation is complete, enter the following command in the terminal: sudo gem install nokogiri

This worked for me. Hopefully it works for you as well.

Brant Wellman
Brant Wellman
9,748 Points

I was having this same issue, and Derek's solution worked for me. I'm now moving forward. Thanks!

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Jac;

I am running Rails 4.1 as well and did not have any issue installing rspec or capybara, so I don't believe that is the issue.

Can you provide a little bit of additional information in terms of the Operating System version and type as well as any additional development environment information?

Mac OS X 10.9 and what exactly do you mean by development environment? Im pretty new to this so some things are a little confusing to me.

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

I was thinking about any other software you have installed which might be hampering your gems. If you have been strictly installing things from the video, you are probably okay with conflicts. While I have Mac experience I don't develop on one so I will let someone with more specific Mac knowledge assist you through your gem issues.

Best of luck!

Thank you...I appreciate everything!