2012-07-09 115 views
0

我知道這是一個老問題,我看到很多與同一問題有關的問題。我仍然得到相同的錯誤。我遵循解決方案並相應地更改了我的gem文件,但我仍然遇到同樣的問題。我使用Ubuntu。 下面是我的問題,當我運行混帳推Heroku的主人在邁克爾·哈特爾的教程說:Ruby on rails使用sqlite3 git push heroku master問題

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_t7ck4nq1x4dd/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6 for inspection. 
     Results logged to /tmp/build_t7ck4nq1x4dd/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]:pure-dusk-8885.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to '[email protected]:pure-dusk-8885.git' 

這裏是我的Gemfile

source 'https://rubygems.org' 

gem 'rails', '3.2.5' 

# Bundle edge Rails instead: 
# gem 'rails', :git => 'git://github.com/rails/rails.git' 

group :production do 
    gem 'pg' 
end 

group :development, :test do 
    gem 'sqlite3' 
    gem 'taps' 
    gem 'rvm' 
end 

# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', '~> 3.2.3' 
    gem 'coffee-rails', '~> 3.2.1' 

    # See https://github.com/sstephenson/execjs#readme for more supported runtimes 
    # gem 'therubyracer', :platforms => :ruby 

    gem 'uglifier', '>= 1.0.3' 
end 

gem 'jquery-rails' 

# To use ActiveModel has_secure_password 
# gem 'bcrypt-ruby', '~> 3.0.0' 

# To use Jbuilder templates for JSON 
# gem 'jbuilder' 

# Use unicorn as the app server 
# gem 'unicorn' 

# Deploy with Capistrano 
# gem 'capistrano' 

# To use debugger 
# gem 'debugger' 

請幫

回答

0

正如Ryan Bigg所說,您應該在開發和生產環境中擁有相同的環境,以便稍後在部署到生產環境時不會有意外。

但是,如果你不關心這一點,並希望保持與sqlite我認爲你只需要運行bundle install。我想你改變了你的GemFile,但沒有運行軟件包安裝。

+0

我運行bundle install,刪除了sqlite3 gem,將它提交給git,但仍然得到同樣的錯誤:( – user1455116 2012-07-09 02:24:55

+0

刪除GemFile.lock – 2012-07-09 02:25:52

+0

是的,我也刪除了那個,運行bundle安裝後有gemfile.lock ,我刪除了gemfile.lock,以便sqlite3的依賴關係可能會被刪除,然後運行git push heroku master,而且我仍然可以得到相同的結果,是因爲我已經創建了first_app,而database.yml的格式是sqlite3 ? – user1455116 2012-07-09 02:41:39

0

刪除sqlite3的從你的Gemfile。開發僅使用pg gem,以便您正在開發與您正在部署的數據庫系統完全相同的數據庫系統。

如果您沒有這樣做,那麼當您在兩個數據庫系統之間切換時,可能會遇到問題。