2

当我尝试推送到 heroku 时,git push heroku master我收到错误:

Counting objects: 55, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (43/43), done.
Writing objects: 100% (43/43), 4.01 KiB, done.
Total 43 (delta 33), reused 0 (delta 0)

-----> Heroku receiving push
-----> Removing .DS_Store files
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.1.2
       Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
       Fetching gem metadata from https://rubygems.org/.......
       Using rake (0.9.2.2)
       Using i18n (0.6.0)
       Using multi_json (1.1.0)
       Using activesupport (3.2.1)
       Using builder (3.0.0)
       Using activemodel (3.2.1)
       Using erubis (2.7.0)
       Using journey (1.0.3)
       Using rack (1.4.1)
       Using rack-cache (1.2)
       Using rack-test (0.6.1)
       Using hike (1.2.1)
       Using tilt (1.3.3)
       Using sprockets (2.1.2)
       Using actionpack (3.2.1)
       Using mime-types (1.17.2)
       Using polyglot (0.3.3)
       Using treetop (1.4.10)
       Using mail (2.4.3)
       Using actionmailer (3.2.1)
       Using arel (3.0.2)
       Using tzinfo (0.3.32)
       Using activerecord (3.2.1)
       Using activeresource (3.2.1)
       Using bcrypt-ruby (3.0.1)
       Using bootstrap-sass (2.0.0)
       Using will_paginate (3.0.3)
       Using bootstrap-will_paginate (0.0.5)
       Using coffee-script-source (1.2.0)
       Using execjs (1.3.0)
       Using coffee-script (2.2.0)
       Using rack-ssl (1.3.2)
       Using json (1.6.5)
       Using rdoc (3.12)
       Using thor (0.14.6)
       Using railties (3.2.1)
       Using coffee-rails (3.2.2)
       Using faker (1.0.1)
       Using geocoder (1.1.1)
       Using jquery-rails (2.0.0)
       Using pg (0.12.2)
       Using bundler (1.1.2)
       Using rails (3.2.1)
       Installing rest-client (1.6.7)
       Using sass (3.1.15)
       Using sass-rails (3.2.4)
       Installing sequel (3.20.0)
       Installing sinatra (1.0)
       Installing sqlite3 (1.3.5) with native extensions
       Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
       /usr/local/bin/ruby extconf.rb
       checking for sqlite3.h... no
       sqlite3.h is missing. Try 'port install sqlite3 +universal'
       or 'yum install sqlite-devel' and check your shared library search path (the
       location where your sqlite3 shared library is located).
       *** 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/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
       --enable-local
       --disable-local
       Gem files will remain installed in /tmp/build_1t9khulyu1uqj/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.5 for inspection.
       Results logged to /tmp/build_1t9khulyu1uqj/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.5/ext/sqlite3/gem_make.out
       An error occured while installing sqlite3 (1.3.5), and Bundler cannot continue.
       Make sure that `gem install sqlite3 -v '1.3.5'` succeeds before bundling.
 !
 !     Failed to install gems via Bundler.
 !
 !     Heroku push rejected, failed to compile Ruby/rails app

如您所见,捆绑安装不包括开发和测试(或者它显示在顶部),以及我的 gemfile:

 source 'https://rubygems.org'

gem 'rails', '3.2.1'
gem 'bootstrap-sass', '2.0.0'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.0.1'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.5'
gem 'taps'

group :production do
  gem 'pg', '0.12.2'
end

group :development do
  gem 'sqlite3', '1.3.5'
  gem 'annotate', '~> 2.4.1.beta'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '3.2.4'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier', '1.2.3'
end

gem 'jquery-rails', '2.0.0'

group :test, :development do
  gem 'rspec-rails', '~> 2.8.rc'
  gem 'guard-rspec', '0.5.5'
  gem 'guard-spork', '0.3.2'
  gem 'spork', '0.9.0'
end

group :test do
  gem 'capybara', '1.1.2'
  gem 'factory_girl_rails', '1.4.0'
  gem 'cucumber-rails', '1.2.1'
  gem 'database_cleaner', '0.7.0'
end

#Nifty Scaffold

gem 'nifty-generators', :group => :development

# Location - Geocoder

gem 'geocoder'


gem "mocha", :group => :test

但是您仍然可以看到该捆绑包正在尝试安装 sqlite,因此失败了。知道可能出了什么问题吗?非常感谢。

4

1 回答 1

0

我有这个问题。经过一番摸索后,我意识到在对 Gemfile 进行更改后,我忘记了运行 git commit,然后才推送到 heroku。

于 2013-01-25T18:40:27.897 回答