Mac an Error Occurred While Installing Sqlite3 1313 and Bundler Cannot Continue

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.

alborz

seal-mask

I'm getting an error when typing "rails new testapp" -- cannot create app

Hi!

So I just reinstalled my Mac and restored most of my older stuff back onto my machine.

Anyway, when I type rails new testapp I get the following:

                                Gem::Ext::BuildError: ERROR: Failed to build gem native extension.                                                                                  /Users/alborz/.rvm/rubies/ruby-2.1.4/bin/ruby -r ./siteconf20141214-94508-wf5b6t.rb extconf.rb                                checking for sqlite3.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=/Users/alborz/.rvm/rubies/ruby-2.1.4/bin/ruby                                                  --with-sqlite3-dir                                                  --without-sqlite3-dir                                                  --with-sqlite3-include                                                  --without-sqlite3-include=${sqlite3-dir}/include                                                  --with-sqlite3-lib                                                  --without-sqlite3-lib=${sqlite3-dir}/lib                                /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)                                You have to install development tools first.                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:587:in `try_cpp'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:1120:in `block in find_header'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:321:in `open'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:321:in `open'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:1119:in `find_header'                                                  from extconf.rb:30:in `<                  main                  >'                                                                extconf failed, exit code 1                                                                Gem files will remain installed in /Users/alborz/.rvm/gems/ruby-2.1.4/gems/sqlite3-1.3.10 for inspection.                                Results logged to /Users/alborz/.rvm/gems/ruby-2.1.4/extensions/x86_64-darwin-13/2.1.0-static/sqlite3-1.3.10/gem_make.out                                An error occurred while installing sqlite3 (1.3.10), and Bundler cannot continue.                                Make sure that `gem install sqlite3 -v '1.3.10'` succeeds before bundling.                                                  run  bundle exec spring binstub --all                                /Users/alborz/.rvm/gems/ruby-2.1.4/gems/bundler-1.7.9/lib/bundler/resolver.rb:368:in `resolve': Could not find gem 'sqlite3 (>= 0) ruby' in the gems available on this machine. (Bundler::GemNotFound)                                                  from /Users/alborz/.rvm/gems/ruby-2.1.4/gems/bundler-1.7.9/lib/bundler/resolver.rb:166:in `start'                                                  from /Users/alborz/.rvm/gems/ruby-2.1.4/gems/bundler-1.7.9/lib/bundler/resolver.rb:129:in `resolve'                                                  from /Users/alborz/.rvm/gems/ruby-2.1.4/gems/bundler-1.7.9/lib/bundler/definition.rb:193:in `resolve'                                                  from /Users/alborz/.rvm/gems/ruby-2.1.4/gems/bundler-1.7.9/lib/bundler/definition.rb:132:in `specs'                                                  from /Users/alborz/.rvm/gems/ruby-2.1.4/gems/bundler-1.7.9/lib/bundler/definition.rb:177:in `specs_for'                                                  from /Users/alborz/.rvm/gems/ruby-2.1.4/gems/bundler-1.7.9/lib/bundler/definition.rb:166:in `requested_specs'                                                  from /Users/alborz/.rvm/gems/ruby-2.1.4/gems/bundler-1.7.9/lib/bundler/environment.rb:18:in `requested_specs'                                                  from /Users/alborz/.rvm/gems/ruby-2.1.4/gems/bundler-1.7.9/lib/bundler/runtime.rb:13:in `setup'                                                  from /Users/alborz/.rvm/gems/ruby-2.1.4/gems/bundler-1.7.9/lib/bundler.rb:122:in `setup'                                                  from /Users/alborz/.rvm/gems/ruby-2.1.4/gems/bundler-1.7.9/lib/bundler/setup.rb:17:in `<                  top                  (                  required                  )                  >'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'                              

I wasn't able to do a gem install sqlite3, so I did brew install sqlite3

When I try to do gem install sqlite3 -v '1.3.10 I get the following:

                                Building native extensions.  This could take a while...                                ERROR:  Error installing sqlite3:                                                  ERROR: Failed to build gem native extension.                                                                                  /Users/alborz/.rvm/rubies/ruby-2.1.4/bin/ruby -r ./siteconf20141214-94534-zh0i03.rb extconf.rb                                checking for sqlite3.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=/Users/alborz/.rvm/rubies/ruby-2.1.4/bin/ruby                                                  --with-sqlite3-dir                                                  --without-sqlite3-dir                                                  --with-sqlite3-include                                                  --without-sqlite3-include=${sqlite3-dir}/include                                                  --with-sqlite3-lib                                                  --without-sqlite3-lib=${sqlite3-dir}/lib                                /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)                                You have to install development tools first.                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:587:in `try_cpp'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:1120:in `block in find_header'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:321:in `open'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:321:in `open'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'                                                  from /Users/alborz/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/mkmf.rb:1119:in `find_header'                                                  from extconf.rb:30:in `<                  main                  >'                                                                extconf failed, exit code 1                                                                Gem files will remain installed in /Users/alborz/.rvm/gems/ruby-2.1.4/gems/sqlite3-1.3.10 for inspection.                                Results logged to /Users/alborz/.rvm/gems/ruby-2.1.4/extensions/x86_64-darwin-13/2.1.0-static/sqlite3-1.3.10/gem_make.out                              

Thanks in advance!!

1 Answer

Looks like an issue with sqlite.

First check if you have sqlite gem by running gem list. If it's not installed, install it with gem install sqlite3 -- --with-sqlite3-dir=/opt/local

If that doesn't work try running xcode-select --install, then running rails.

lancasterduchich.blogspot.com

Source: https://teamtreehouse.com/community/im-getting-an-error-when-typing-rails-new-testapp-cannot-create-app

0 Response to "Mac an Error Occurred While Installing Sqlite3 1313 and Bundler Cannot Continue"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel