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

Can't install devise

I have ruby 1.9.3 & rails 3.2.12. I got stuck after running bundle. (gem devise was added to the Gemfile already). This is the error: An error occurred while installing atomic (1.1.14), and Bundler cannot continue. Make sure that gem install atomic -v '1.1.14' succeeds before bundling. Then, ERROR: Error installing atomic: ERROR: Failed to build gem native extension.

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

*** 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. Thanks for your help!

4 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hey Sergio Barrera maybe we can try downgrading devise in your Gemfile to a previous version to try and get it to work. In your Gemfile, where it says

gem 'devise'

Try making it:

gem 'devise', '2.2.7'

Then run bundle install again and let us know if it works!

Thank you Jason for checking out on this, I really like this rails tutorial and how you guys presented the material. I changed it to 2.2.7 and now I get this error: An error occurred while installing bcrypt-ruby (3.1.2), and Bundler cannot continue. Make sure that gem install bcrypt-ruby -v '3.1.2' succeeds before bundling. I tried running this gem and it failed: ERROR: Error installing bcrypt-ruby: 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.2 for inspection. Results logged to /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bcrypt-ruby-3.1.2/ext/mri/gem_make.out

Hi Jason, Also, I already have xcode-tools installed. At this point, I'm now trying to upgrade to ruby 2 / rails 4 and see if can use devise or build anything with rails. Thanks for your help!

I was able to go through the reinstallation of rails to rails 4 manually and now I'm taking the next steps to generate devise views. I find some similarities and some other differences but it's 99% working. I'm right now reading the devise docs because the current user can't sig out. I'll post more updates soon!