2016-01-01 41 views
1

注意:絕對初學者。我注意到大多數類似問題的答案都表明SQlite3不能與Heroku一起使用,並推薦使用PostgreSQL。在對這個方向做任何改變之前,我想知道這樣做是否會影響我遵循/理解教程的能力?未能推向heroku! (Micharl Hartle Rails Tutorial 3 - 示例應用程序)

我正在使用作者提供的最新gemfile。它是在2015年11月25日更新的。(這就是爲什麼我驚訝它包含SQlite3寶石?)

我是一個絕對的初學者,剛開始學習編程2天后(解釋將與解決方案一起大加讚賞(在語言,是簡化地)謝謝

OS:!Windows 8.1中 IDE:CLOUD9 混帳推到一個帳戶到位桶

捆綁安裝--without生產,是成功的。 Git初始化和進一步更新都沒有錯誤

source 'https://rubygems.org' 

gem 'rails',     '4.2.2' 
gem 'bcrypt',     '3.1.7' 
gem 'faker',     '1.4.2' 
gem 'carrierwave',    '0.10.0' 
gem 'mini_magick',    '3.8.0' 
gem 'fog',      '1.36.0' 
gem 'will_paginate',   '3.0.7' 
gem 'bootstrap-will_paginate', '0.0.10' 
gem 'bootstrap-sass',   '3.2.0.0' 
gem 'sass-rails',    '5.0.2' 
gem 'uglifier',    '2.5.3' 
gem 'coffee-rails',   '4.1.0' 
gem 'jquery-rails',   '4.0.3' 
gem 'turbolinks',    '2.3.0' 
gem 'jbuilder',    '2.2.3' 
gem 'sdoc',     '0.4.0', group: :doc 

group :development, :test do 
    gem 'sqlite3',  '1.3.9' 
    gem 'byebug',  '3.4.0' 
    gem 'web-console', '2.0.0.beta3' 
    gem 'spring',  '1.1.3' 
end 

group :test do 
    gem 'minitest-reporters', '1.0.5' 
    gem 'mini_backtrace',  '0.1.3' 
    gem 'guard-minitest',  '2.3.1' 
end 

group :production do 
    gem 'pg',    '0.17.1' 
    gem 'rails_12factor', '0.0.2' 
    gem 'puma',   '2.11.1' 
end 

這是出現在失敗「的git推heroku上主」指令

remote:  Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 
remote:   
remote:  /tmp/build_1933bfd027d23ded5c4a036825ecff71/vendor/ruby-2.0.0/bin/ruby extconf.rb 
remote:  checking for sqlite3.h... no 
remote:  sqlite3.h is missing. Try 'port install sqlite3 +universal', 
remote:  'yum install sqlite-devel' or 'apt-get install libsqlite3-dev' 
remote:  and check your shared library search path (the 
remote:  location where your sqlite3 shared library is located). 
remote:  *** extconf.rb failed *** 
remote:  Could not create Makefile due to some reason, probably lack of necessary 
remote:  libraries and/or headers. Check the mkmf.log file for more details. You may 
remote:  need configuration options. 
remote:   
remote:  Provided configuration options: 
remote:  --with-opt-dir 
remote:  --without-opt-dir 
remote:  --with-opt-include 
remote:  --without-opt-include=${opt-dir}/include 
remote:  --with-opt-lib 
remote:  --without-opt-lib=${opt-dir}/lib 
remote:  --with-make-prog 
remote:  --without-make-prog 
remote:  --srcdir=. 
remote:  --curdir 
remote:  --ruby=/tmp/build_1933bfd027d23ded5c4a036825ecff71/vendor/ruby-2.0.0/bin/ruby 
remote:  --with-sqlite3-dir 
remote:  --without-sqlite3-dir 
remote:  --with-sqlite3-include 
remote:  --without-sqlite3-include=${sqlite3-dir}/include 
remote:  --with-sqlite3-lib 
remote:  --without-sqlite3-lib=${sqlite3-dir}/ 
remote:   
remote:   
remote:  Gem files will remain installed in /tmp/build_1933bfd027d23ded5c4a036825ecff71/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11 for inspection. 
remote:  Results logged to /tmp/build_1933bfd027d23ded5c4a036825ecff71/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11/ext/sqlite3/gem_make.out 
remote:  An error occurred while installing sqlite3 (1.3.11), and Bundler cannot 
remote:  continue. 
remote:  Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling. 
remote: ! 
remote: !  Failed to install gems via Bundler. 
remote: !  
remote: !  Detected sqlite3 gem which is not supported on Heroku. 

如果SQLITE3寶石是ommitted生產組中,因爲是情況下,在以前的端部的錯誤信息練習,爲什麼只有在練習中才會發生這種情況?

+0

'git status'說什麼?在你的項目文件夾中運行它。 –

回答

1

Heroku不支持SQLite,你需要切換到PG。使用PG不會影響您遵循教程的能力,因爲ActiveRecord會抽象出底層數據庫特定的命令。

您只需確保不依賴任何特定於SQLite的功能或行爲。

相關問題