2013-01-12 61 views
0

Possible Duplicate:
Heroku, Rails 3 and sqlite3混帳推Heroku的主W /錯誤:未能一些裁判推到「[email protected]:浮林地-1763.git」

我使用一個CentOS 6.3操作系統和我有麻煩推我的應用程序的Heroku使用Git

我鍵入:

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 [email protected]:floating-woodland-1763.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to '[email protected]:floating-woodland-1763.git' 

我有sqlite3版本1.3.6肯定安裝,因爲我檢查和雙重檢查。 我也跑了,並得到:

git remote -v 
heroku [email protected]:floating-woodland-1763.git (fetch) 
heroku [email protected]:floating-woodland-1763.git (push) 
origin [email protected]:(user)/first_app.git (fetch) 
origin [email protected]:(user)/first_app.git (push) 

我不知道該怎麼辦,請大家幫忙。 =)

+0

Heroku不支持sqlite。 這裏看到更多的信息: http://stackoverflow.com/questions/3747002/heroku-rails-3-and-sqlite3 – mscccc

回答

0

你不能在Heroku上使用sqlite。他們提供了PostgreSQL的免費開發版本。你可以將它設置在他們的Web界面或命令行:

heroku addons:add heroku-postgresql:dev 

有,當然,你的這個數據庫的使用限制,同Heroku開始時你的應用達到一定規模的充電你。您需要獲取您的插件的登錄憑據。最簡單的方法是到Heroku.com上的應用程序,點擊PG插件,然後從下拉列表中選擇「Active Record」。這實際上會在您的config/database.yml文件中顯示您需要的YAML以連接到Heroku DB。

您需要將gem 'pg'添加到您的gem文件中。 Heroku建議您在您的開發機器上安裝PG,但如果您不想這樣做,只需在group :production下添加pg gem即可。

底線:你不能在Heroku上使用sqlite。如果這是一個破壞交易的行爲,請檢查Amazon EC2或其他數千個其他託管站點。

相關問題