【问题标题】:git push heroku master w/ error: failed to push some refs to 'git@heroku.com:floating-woodland-1763.git' [duplicate]git push heroku master w/error:未能将一些参考推送到“git@heroku.com:floating-woodland-1763.git”[重复]
【发布时间】:2012-12-26 20:51:22
【问题描述】:

可能重复:
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)

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

【问题讨论】:

标签: git heroku github


【解决方案1】:

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

heroku addons:add heroku-postgresql:dev

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

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

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

【讨论】:

    猜你喜欢
    • 2012-04-07
    • 2011-05-23
    • 2018-03-27
    • 2012-04-05
    • 2022-01-25
    • 2012-08-16
    • 1970-01-01
    • 1970-01-01
    • 2021-08-07
    相关资源
    最近更新 更多