Search code examples
ruby-on-railsrubysqliteherokucygwin

Ruby app push to Heroku failed because of SQLite using Cygwin


I am running a Windows 7 installation.

This is the first time I have encontered a problem. After I use the command:

git push heroku master

This is the Cygwin bash output:

> The authenticity of host 'heroku.com (50.19.85.156)' can't be
> established. RSA key fingerprint is
> 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad. Are you sure you want
> to continue connecting (yes/no)? yes Warning: Permanently added
> 'heroku.com,50.19.85.156' (RSA) to the list of known   hosts. Counting
> objects: 60, done. Delta compression using up to 8 threads.
> Compressing objects: 100% (47/47), done. Writing objects: 100%
> (60/60), 85.66 KiB, done. Total 60 (delta 2), reused 0 (delta 0)
> 
> -----> Ruby app detected
> -----> Compiling Ruby/Rails
> -----> Using Ruby version: ruby-2.0.0
> -----> Installing dependencies using Bundler version 1.3.2
>        New app detected loading default bundler cache
>        Running: bundle install --without development:test --path vendor/bundle -  -binstubs vendor/bundle/bin --deployment
>        Fetching gem metadata from http://rubygems.org/.........
>        Fetching gem metadata from http://rubygems.org/..
>        Using rake (10.1.0)
>        Installing abstract (1.0.0)
>        Installing activesupport (3.0.1)
>        Installing builder (2.1.2)
>        Installing i18n (0.4.2)
>        Installing activemodel (3.0.1)
>        Installing erubis (2.6.6)
>        Installing rack (1.2.8)
>        Installing rack-mount (0.6.14)
>        Installing rack-test (0.5.7)
>        Using tzinfo (0.3.38)
>        Installing actionpack (3.0.1)
>        Installing mime-types (1.25.1)
>        Using polyglot (0.3.3)
>        Using treetop (1.4.15)
>        Installing mail (2.2.20)
>        Installing actionmailer (3.0.1)
>        Installing arel (1.0.1)
>        Installing activerecord (3.0.1)
>        Installing activeresource (3.0.1)
>        Using bundler (1.3.2)
>        Installing thor (0.14.6)
>        Installing railties (3.0.1)
>        Installing rails (3.0.1)
>        Installing sqlite3-ruby (1.2.5)
>        Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native ex  tension.
>        /tmp/build_2ad04c34-9506-4a88-a27c-47f7374f0b0c/vendor/ruby-2.0.0/bin/rub
> y extconf.rb
>        checking for fdatasync() in -lrt... yes
>        checking for sqlite3.h... no
>        *** 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=/tmp/build_2ad04c34-9506-4a88-a27c-47f7374f0b0c/vendor/ruby-2.0.0/
> 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}/
>        --with-rtlib
>        --without-rtlib
>        Gem files will remain installed in /tmp/build_2ad04c34-9506-4a88-a27c-47f 
> 7374f0b0c/vendor/bundle/ruby/2.0.0/gems/sqlite3-ruby-1.2.5 for
> inspection.
>        Results logged to /tmp/build_2ad04c34-9506-4a88-a27c-47f7374f0b0c/vendor/ 
> bundle/ruby/2.0.0/gems/sqlite3-ruby-1.2.5/ext/sqlite3_api/gem_make.out
>        An error occurred while installing sqlite3-ruby (1.2.5), and Bundler cann  ot
>        continue.
>        Make sure that `gem install sqlite3-ruby -v '1.2.5'` succeeds before bund  ling.
>        Bundler Output: Fetching gem metadata from http://rubygems.org/.........
>        Fetching gem metadata from http://rubygems.org/..
>        Using rake (10.1.0)
>        Installing abstract (1.0.0)
>        Installing activesupport (3.0.1)
>        Installing builder (2.1.2)
>        Installing i18n (0.4.2)
>        Installing activemodel (3.0.1)
>        Installing erubis (2.6.6)
>        Installing rack (1.2.8)
>        Installing rack-mount (0.6.14)
>        Installing rack-test (0.5.7)
>        Using tzinfo (0.3.38)
>        Installing actionpack (3.0.1)
>        Installing mime-types (1.25.1)
>        Using polyglot (0.3.3)
>        Using treetop (1.4.15)
>        Installing mail (2.2.20)
>        Installing actionmailer (3.0.1)
>        Installing arel (1.0.1)
>        Installing activerecord (3.0.1)
>        Installing activeresource (3.0.1)
>        Using bundler (1.3.2)
>        Installing thor (0.14.6)
>        Installing railties (3.0.1)
>        Installing rails (3.0.1)
>        Installing sqlite3-ruby (1.2.5)
>        Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native ex  tension.
> 
>        /tmp/build_2ad04c34-9506-4a88-a27c-47f7374f0b0c/vendor/ruby-2.0.0/bin/rub
> y extconf.rb
>        checking for fdatasync() in -lrt... yes
>        checking for sqlite3.h... no
>        *** 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=/tmp/build_2ad04c34-9506-4a88-a27c-47f7374f0b0c/vendor/ruby-2.0.0/
> 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}/
>        --with-rtlib
>        --without-rtlib
> 
> 
>        Gem files will remain installed in /tmp/build_2ad04c34-9506-4a88-a27c-47f 
> 7374f0b0c/vendor/bundle/ruby/2.0.0/gems/sqlite3-ruby-1.2.5 for
> inspection.
>        Results logged to /tmp/build_2ad04c34-9506-4a88-a27c-47f7374f0b0c/vendor/ 
> bundle/ruby/2.0.0/gems/sqlite3-ruby-1.2.5/ext/sqlite3_api/gem_make.out
>        An error occurred while installing sqlite3-ruby (1.2.5), and Bundler cann  ot
>        continue.
>        Make sure that `gem install sqlite3-ruby -v '1.2.5'` succeeds before bund  ling.  !  !     Failed to install gems via Bundler.  !
> 
>  !     Push rejected, failed to compile Ruby app
> 
> To [email protected]:limitless-fortress-4709.git  ! [remote rejected]
> master -> master (pre-receive hook declined) error: failed to push
> some refs to '[email protected]:limitless-fortress-4709.git'

I am really sorry for the extensive post, I just want to make sure I can give anyone willing to help the necessary information. I know the problem it's in the SQLite gem, I just can't put my finger on it.

Thank you very much for your time.


Solution

  • You can't use SQLite with heroku, you should change your production database to postgreSQL.

    Check out the explanation and instructions on how to set up PostgreSQL here: https://devcenter.heroku.com/articles/sqlite3