git push heroku master w / error:未能将某些引用推送到'git@heroku.com:floating-woodland-1763.git'

时间:2013-01-12 10:08:12

标签: git heroku github

  

可能重复:
  Heroku, Rails 3 and sqlite3

我正在使用Centos 6.3操作系统,但我无法使用Git将我的应用程序推送到heroku

我输入的内容:

git push heroku master

我得到了什么:

Counting objects: 70, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (55/55), done.
Writing objects: 100% (70/70), 86.84 KiB, done.
Total 70 (delta 7), reused 0 (delta 0)
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.3.0.pre.5
   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/..
   Installing rake (10.0.3)
   Installing abstract (1.0.0)
   Installing activesupport (3.0.19)
   Installing builder (2.1.2)
   Installing i18n (0.5.0)
   Installing activemodel (3.0.19)
   Installing erubis (2.6.6)
   Installing rack (1.2.6)
   Installing rack-mount (0.6.14)
   Installing rack-test (0.5.7)
   Installing tzinfo (0.3.35)
   Installing actionpack (3.0.19)
   Installing mime-types (1.19)
   Installing polyglot (0.3.3)
   Installing treetop (1.4.12)
   Installing mail (2.2.19)
   Installing actionmailer (3.0.19)
   Installing arel (2.0.10)
   Installing activerecord (3.0.19)
   Installing activeresource (3.0.19)
   Installing json (1.7.6)
   Using bundler (1.3.0.pre.5)
   Installing rdoc (3.12)
   Installing thor (0.14.6)
   Installing railties (3.0.19)
   Installing rails (3.0.19)
   Installing sqlite3 (1.3.6)
   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_ozcea9mu00be/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6 for inspection.
   Results logged to /tmp/build_ozcea9mu00be/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6/ext/sqlite3/gem_make.out
   An error occurred while installing sqlite3 (1.3.6), and Bundler cannot continue.
   Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.
 !
 !     Failed to install gems via Bundler.
 !
 !     Heroku push rejected, failed to compile Ruby/rails app

To git@heroku.com:floating-woodland-1763.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:floating-woodland-1763.git'

我已经安装了sqlite3版本1.3.6,因为我检查并仔细检查过。 我也跑了,得到了:

git remote -v
heroku  git@heroku.com:floating-woodland-1763.git (fetch)
heroku  git@heroku.com:floating-woodland-1763.git (push)
origin  git@github.com:(user)/first_app.git (fetch)
origin  git@github.com:(user)/first_app.git (push)

我不知道该怎么做,请帮忙。 =)

1 个答案:

答案 0 :(得分:0)

你不能在Heroku上使用sqlite。他们提供PostgreSQL的免费开发版本。您可以使用以下命令在其Web界面或命令行上进行设置:

heroku addons:add heroku-postgresql:dev

当然,您对此数据库的使用存在限制,因为当您的应用达到一定规模时,Heroku会向您收取费用。您需要获取插件的登录凭据。最简单的方法是在Heroku.com上访问您的应用程序,单击PG插件,然后从下拉列表中选择“Active Record”。这实际上会在config/database.yml文件中显示您需要的YAML以连接到Heroku数据库。

您需要将gem 'pg'添加到您的gemfile中。 Heroku建议您在开发机器上安装PG,但如果您不想这样做,可以在group :production下添加pg gem。

底线:你不能在Heroku上使用sqlite。如果这是一个交易破坏者,请查看Amazon EC2或其他数千个其他托管网站。