2012-06-12 78 views
8

第一個職位在這裏=)在此先感謝幫助,任何幫助很酷在這一點上!無法推送到heroku - sqlite3.h缺失

1 - 我已經搜查了很多,想的東西負荷考慮在發佈之前計算器..

2 - 當運行

git push heroku master 

我得到這個:

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). 

3我檢查了Gemfile:生產和開發/測試分別配置爲pg和sqlite3分別爲

4- Sqlite3.h是在這裏:

pcbo$ ls -l /usr/include/sqlite3.h 
    -rw-r--r-- 1 root wheel 322724 7 Dec 2011 /usr/include/sqlite3.h 

5-忘記提到我使用的Mac OS X ..

-6-輸出: pcbo $ GIT中推heroku上主

Counting objects: 71, done. 
    Delta compression using up to 4 threads. 
    Compressing objects: 100% (58/58), done. 
    Writing objects: 100% (71/71), 26.46 KiB, done. 
    Total 71 (delta 8), reused 0 (delta 0) 

    -----> Heroku receiving push 
    -----> Ruby/Rails app detected 
    -----> Installing dependencies using Bundler version 1.2.0.pre 
    Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment 
    Fetching gem metadata from https://rubygems.org/....... 
    Installing rake (0.9.2.2) 
    Installing i18n (0.6.0) 
    Installing multi_json (1.3.6) 
    Installing activesupport (3.2.3) 
    Installing builder (3.0.0) 
    Installing activemodel (3.2.3) 
    Installing erubis (2.7.0) 
    Installing journey (1.0.3) 
    Installing rack (1.4.1) 
    Installing rack-cache (1.2) 
    Installing rack-test (0.6.1) 
    Installing hike (1.2.1) 
    Installing tilt (1.3.3) 
    Installing sprockets (2.1.3) 
    Installing actionpack (3.2.3) 
    Installing mime-types (1.18) 
    Installing polyglot (0.3.3) 
    Installing treetop (1.4.10) 
    Installing mail (2.4.4) 
    Installing actionmailer (3.2.3) 
    Installing arel (3.0.2) 
    Installing tzinfo (0.3.33) 
    Installing activerecord (3.2.3) 
    Installing activeresource (3.2.3) 
    Installing coffee-script-source (1.3.3) 
    Installing execjs (1.4.0) 
    Installing coffee-script (2.2.0) 
    Installing rack-ssl (1.3.2) 
    Installing json (1.7.3) with native extensions 
    Installing rdoc (3.12) 
    Installing thor (0.14.6) 
    Installing railties (3.2.3) 
    Installing coffee-rails (3.2.2) 
    Installing jquery-rails (2.0.2) 
    Installing pg (0.12.2) with native extensions 
    Using bundler (1.2.0.pre) 
    Installing rails (3.2.3) 
    Installing sass (3.1.19) 
    Installing sass-rails (3.2.5) 
    Installing sqlite3 (1.3.6) 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_zmjrcoagwpai/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6 for inspection. 
    Results logged to /tmp/build_zmjrcoagwpai/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 

7-任何幫助真的很感激!

+0

那是'LS從本地開發機器或Heroku的機器-l'輸出那會運行你的軟件? – sarnold

+0

@sarnold:這是我的本地開發機器 – pcbo

+0

你使用雪松堆棧嗎? –

回答

11

[UPDATE1]

從你的混帳推日誌,這是你的罪魁禍首: -

Installing sqlite3 (1.3.6) with native extensions 

所以,就像我一開始懷疑,錯誤試圖加載sqlite3寶石這都將失敗Heroku的。正如前面所說的會發生這種情況是因爲兩個原因

  1. Gemfile中被錯誤地配置爲需要sqlite3的寶石生產
  2. 其他一些寶石有sqlite3寶石的依賴。使用gem dependency命令來顯示gem &的依賴關係,刪除那個取決於sqlite3的gem。

之後,重新運行bundle install &它會工作。

--- [結束UPDATE1] ---

你可以得到這個錯誤的唯一原因是,當,試圖用在Heroku sqlite3數據庫不被支持。所以仔細檢查你的Gemfile,並確保其設置類似於此

group :production do 
    gem 'pg' 
end 
group :development, :test do 
    gem 'sqlite3' 
end 

然後做bundle install再生您Gemfile.lock。現在,嘗試推Herku。如果你仍然得到這個錯誤,那麼你可能使用的一些寶石在其gemspec文件中列出sqlite3作爲硬編碼的依賴關係。所以實際上,sqlite3正在被加載,即使它不存在於gemfile中。所以請驗證這一點,在本地主機上運行以下命令:

$ bundle install | grep sqlite 

最後,嘗試此操作後。它不起作用。發回完成日誌git push heroku master &輸出heroku logs

+0

Hi @Gaurish。正如我之前提到的,Gemfile已正確配置並且'bundle install | grep sqlite'返回'使用sqlite3(1.3.6)' _檢查現在如何檢索heroku logs_ – pcbo

+0

** Heroku日誌:** 2012-06-12T00:53:42 + 00:00 heroku [slugc ]:Slug編譯開始 2012-06-12T00:54:09 + 00:00 heroku [slugc]:Slug編譯失敗:未能編譯Ruby/rails應用程序 2012-06-12T09:20:31 + 00:00 heroku [slugc]:Slug編譯開始 2012-06-12T09:21:04 + 00:00 heroku [slugc]:Slug編譯失敗:未能編譯Ruby/rails應用程序 _is這是您要求的日誌?_ Doesn' t給很多信息.. – pcbo

+0

'git push heroku master'的日誌是在原來的問題(步驟6) – pcbo

0

似乎缺少sqlite庫。 嘗試與

whereis sqlite3.h 

找到它,如果它在你的系統中,嘗試:

sudo gem install sqlite3-ruby -- --with-sqlite3-include=<"url where it is(for eg: /usr/include)"> 

問候

+0

謝謝,但問題已解決! :) – pcbo