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

Error when bundling devise

Seems to have an issue installing bcrypt ruby because of some issue with the makefile... -Admittedly new to this and trying to keep up the momentum with the RoR tutorials.

I already searched through existing threads and none of them address this specifically.

Tried updating bundler and tried the idea about commenting out the devise install line in the routes.rb...there was no line in there for the devise_for :installs, guessing since the bundle operation fails?


Here are the errors. Sorry it's lengthy.


Fetching gem metadata from https://rubygems.org/........... Fetching gem metadata from https://rubygems.org/.. Resolving dependencies... Using rake (10.0.4) Using i18n (0.6.4) Using multi_json (1.7.4) Using activesupport (3.2.12) Using builder (3.0.4) Using activemodel (3.2.12) Using erubis (2.7.0) Using journey (1.0.4) Using rack (1.4.5) Using rack-cache (1.2) Using rack-test (0.6.2) Using hike (1.2.2) Using tilt (1.4.1) Using sprockets (2.2.2) Using actionpack (3.2.12) Using mime-types (1.23) Using polyglot (0.3.3) Using treetop (1.4.12) Using mail (2.4.4) Using actionmailer (3.2.12) Using arel (3.0.2) Using tzinfo (0.3.37) Using activerecord (3.2.12) Using activeresource (3.2.12) Installing bcrypt-ruby (3.1.1) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb 

checking for ruby/util.h... *** 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=/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:381:in try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:506:intry_cpp' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:931:in block in have_header' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:790:inblock in checking_for' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:284:in block (2 levels) in postpone' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:254:inopen' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:284:in block in postpone' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:254:inopen' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:280:in postpone' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:789:inchecking_for' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:930:in have_header' from extconf.rb:14:in<main>'

Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bcrypt-ruby-3.1.1 for inspection. Results logged to /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bcrypt-ruby-3.1.1/ext/mri/gem_make.out An error occurred while installing bcrypt-ruby (3.1.1), and Bundler cannot continue. Make sure that gem install bcrypt-ruby -v '3.1.1' succeeds before bundling.

4 Answers

Hey guys, I got a tip from stackoverflow to uninstall rvm and reinstall. worked like a charm as they say.

Thanks for your help.

Christopher

Awesome!

If you're on a Mac, make sure you have Xcode installed (it's free from the Mac App Store). The error is saying You have to install development tools first, which is the "command line tools" that come with Xcode.

I am on a Mac. thanks, Sean! ...and wow 1.65GB for developer tools...

I downloaded and installed XCode, but I'm getting the identical error including the line about developer tools.

Any other ideas?

Jason Seifer
Jason Seifer
Treehouse Guest Teacher

Hi Christopher, have you restarted your computer since installing XCode? That might help.

Hey, Jason. Thanks for the reply. Of course :) I restarted right after installing.

I just read that I may need to go into the preferences in XCode and install the command line tools manually. That's in progress now. I'll repost one way or another.

Christopher


No dice. Installed the command line tools, restarted, same error except this time I tried to make sure rvm 1.9.3 was running and it gave me the following:

Could not find gem 'devise (>= 0) ruby' in the gems available on this machine. Run bundle install to install missing gems. Christophers-MacBook-Pro:treebook3 crswd$ bundle install Fetching gem metadata from https://rubygems.org/........... Fetching gem metadata from https://rubygems.org/.. Resolving dependencies... Using rake (10.0.4) Using i18n (0.6.4) Using multi_json (1.7.4) Using activesupport (3.2.12) Using builder (3.0.4) Using activemodel (3.2.12) Using erubis (2.7.0) Using journey (1.0.4) Using rack (1.4.5) Using rack-cache (1.2) Using rack-test (0.6.2) Using hike (1.2.2) Using tilt (1.4.1) Using sprockets (2.2.2) Using actionpack (3.2.12) Using mime-types (1.23) Using polyglot (0.3.3) Using treetop (1.4.12) Using mail (2.4.4) Using actionmailer (3.2.12) Using arel (3.0.2) Using tzinfo (0.3.37) Using activerecord (3.2.12) Using activeresource (3.2.12) Installing bcrypt-ruby (3.1.1) Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb 

checking for ruby/util.h... *** 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=/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:381:in try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:506:intry_cpp' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:931:in block in have_header' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:790:inblock in checking_for' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:284:in block (2 levels) in postpone' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:254:inopen' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:284:in block in postpone' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:254:inopen' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:280:in postpone' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:789:inchecking_for' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:930:in have_header' from extconf.rb:14:in<main>'

Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bcrypt-ruby-3.1.1 for inspection. Results logged to /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bcrypt-ruby-3.1.1/ext/mri/gem_make.out

An error occurred while installing bcrypt-ruby (3.1.1), and Bundler cannot continue. Make sure that gem install bcrypt-ruby -v '3.1.1' succeeds before bundling.

If you type which gcc in Terminal, what shows up?

Hey Sean,

Terminal returns:

/usr/bin/gcc

Christopher