2015-11-12 93 views
0

我試圖推動我的heroku上的git。爲此,我使用:git push heroku master error導致的錯誤

$ git push heroku master 

回報:

remote:  --without-sqlite3-lib=${sqlite3-dir}/ 
 
remote:   
 
remote:   
 
remote:  Gem files will remain installed in /tmp/build_ae596310505cf83afbb45a2986208c96/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11 for inspection. 
 
remote:  Results logged to /tmp/build_ae596310505cf83afbb45a2986208c96/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. 
 
remote: !  https://devcenter.heroku.com/articles/sqlite3 
 
remote: ! 
 
remote: 
 
remote: !  Push rejected, failed to compile Ruby app 
 
remote: 
 
remote: Verifying deploy... 
 
remote: 
 
remote: ! \t Push rejected to glacial-taiga-8832. 
 
remote: 
 
To https://git.heroku.com/glacial-taiga-8832.git 
 
! [remote rejected] master -> master (pre-receive hook declined) 
 
error: failed to push some refs to 'https://git.heroku.com/glacial-taiga-8832.git'

如果我這樣做:

$ sudo gem install sqlite3 -v '1.3.11' 

它的工作原理,但同樣的問題。 任何人都可以提供幫助嗎?

回答

1

您需要將sqlite3寶石移動到您的Gemfile的development部分。 Heroku沒有安裝SQLite數據庫。

例子:

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

要使用你需要使用PostgreSQL數據庫(默認)在Heroku上的數據庫。爲了使它工作,你需要將pg寶石加入到production組:

group :production do 
    gem 'pg' 
end 

此外,還有一些你需要更新你的database.yml的機會,但我相信Heroku的將剛剛注入自己的數據庫連接設置在你的配置文件。