由于 sqlite,无法将 rails 代码从 Cloud9 推送到 Heroku

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_12factorpostgres gem。 sqlite3 在开发组中,因此 heroku 不应尝试安装它。

已经有一段时间了,但我曾经遇到过和你一样的错误:

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'

我了解到发生这种情况的原因是不应将 his/her 分支推送到更新的远程分支。

如果我没记错的话,一般的方法是使用类似的东西:

git fetch origin; git merge origin/master

也许可以查看此 link 以获取更多信息:code push to heroku not working

当您使用 postgresql 时,是否已使用以下行将 Procfile 添加到您的应用程序:

web: bundle exec thin start -p $PORT

我在我的 gem 文件中使用以下内容,除了 postgres 部署到 heroku

#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