[英]Can't push rails code to Heroku from Cloud9 because of sqlite
An error occurred while installing sqlite3 (1.3.10), and Bundler cannot
remote: continue.
remote: Make sure that `gem install sqlite3 -v '1.3.10'` 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 stark-reaches-8517.
remote:
To https://git.heroku.com/stark-reaches-8517.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com....
首先,我安裝了最新的sqlite3
,但沒有幫助。 然后我嘗試從sqlite
切換到postgresql
,但是它也沒有解決(或者我只是錯過了一些東西)。 有人可以告訴我gem文件在捆綁之前應該是什么樣嗎? 順便說一句。 我正在嘗試遵循Michael Hartl的《 Rails教程》,但是這里沒有提及任何內容。
我在生產組中有rails_12factor
和postgres
寶石。 sqlite3
在開發組中,因此heroku不應嘗試安裝它。
當您使用postgresql時,您是否使用以下代碼行將Procfile添加到您的應用中:
web: bundle exec thin start -p $PORT
除了將postgres部署到heroku之外,我還在gem文件中使用以下內容
#User the 'thin' server instead of the default webrick
gem 'thin'
#Use postgres and the Heroku rails gem for Heroku
group :production do
gem 'rails_12factor'
end
另外,您是否簽出了heroku幫助中心? 它跳了一些,但更詳細地介紹了如何防御個人資料。
https://devcenter.heroku.com/articles/getting-started-with-ruby#introduction
已經有一段時間了,但我曾經設法以與您相同的錯誤結束:
git push origin master
To https://github.com/Answer_Bot-project/project.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/Answer_Bot-project/project.git'
我讀過,發生這種情況的原因是,不應將他/她的分支推送到更新的遠程分支。
如果我沒記錯的話,一般的方法是使用類似的東西:
git fetch origin; git merge origin/master
也許看一下此鏈接以獲取更多信息:將代碼推送到heroku無效 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.