2016-01-03 95 views
0

我知道這個問題在這裏發生過幾次,但我嘗試了似乎沒有人工作的解決方案。推送應用程序到Heroku時出現問題。所以我型git push heroku master和出現此錯誤:在Heroku上推送被拒絕,導軌

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: ! Push rejected to sleepy-atoll-4840. 
remote: 
To https://git.heroku.com/sleepy-atoll-4840.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to 'https://git.heroku.com/sleepy-atoll-4840.git' 

這是我的Gemfile:

source 'https://rubygems.org' 

gem 'rails', '4.2.4' 

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

gem 'sass-rails', '4.0.0.rc1' 
gem 'uglifier', '2.1.1' 
gem 'coffee-rails', '4.0.0' 
gem 'jquery-rails', '2.2.1' 
gem 'turbolinks', '1.1.1' 
gem 'jbuilder', '1.0.2' 

group :doc do 
    gem 'sdoc', '0.3.20', require: false 
end 

group :production do 
    gem 'pg', '0.18.1' 
end 

任何提示如何克服呢?

+0

確保你運行'束install'然後git的承諾新Gemfile.lock的給你推到之前的Heroku之前提交。 – eugen

回答

0

Heroku doesn't support SQLite

你需要把它存到自己development組或類似:

#Gemfile 
gem "pg", group: :production 
gem "sqlite3", group: :development 

-

當我看到你有這個已經,你需要確保你的Gemfile.lock是正確設置。要做到這一點,最好的辦法是在開發環境中運行以下命令:

$ bundle install --without production 
$ bundle update 
$ git add . 
$ git commit -a -m "Gem" 
$ git push heroku master 
0

Heroku的不支持在生產中的sqlite3 ...

你需要從你的寶石文件中刪除sqlite3的並添加下列。

gem 'sqlite3' 

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

重要:你必須運行

git的補充。 混帳

運行

混帳推Heroku的主