我有推到heroku的问题

时间:2018-06-20 19:12:46

标签: ruby-on-rails git heroku

它在我的本地服务器上正常工作。

现在,我想先进行测试,然后再申请一个实时网站。

但是,当我尝试推送到heroku时,我仍然遇到此错误。

任何人对此都有想法,可以帮助我吗?

谢谢。

carrey:~/workspace/joy (master) $ git push heroku master
Counting objects: 2396, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (743/743), done.
Writing objects: 100% (2396/2396), 13.31 MiB | 1.43 MiB/s, done.
Total 2396 (delta 1520), reused 2396 (delta 1520)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote:        Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-16/ruby-2.1.5.tgz -s -o - | tar zxf - ' failed on attempt 1 of 3.
remote:        Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-16/ruby-2.1.5.tgz -s -o - | tar zxf - ' failed on attempt 2 of 3.
remote:  !
remote:  !     An error occurred while installing ruby-2.1.5
remote:  !     
remote:  !     Heroku recommends you use the latest supported Ruby version listed here:
remote:  !     https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
remote:  !     
remote:  !     For more information on syntax for declaring a Ruby version see:
remote:  !     https://devcenter.heroku.com/articles/ruby-versions
remote:  !     
remote:  !     
remote:  !     Debug InformationCommand: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-16/ruby-2.1.5.tgz -s -o - | tar zxf - ' failed unexpectedly:
remote:  !     
remote:  !     gzip: stdin: unexpected end of file
remote:  !     tar: Child returned status 1
remote:  !     tar: Error is not recoverable: exiting now
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to joynus-ian.
remote: 
To https://git.heroku.com/joynus-ian.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/joy-ian.git'

1 个答案:

答案 0 :(得分:-1)

很难找到错误原因。由于未显示要执行的步骤,因此请部署到Heroku。如果您错过某些必需的步骤,通常会发生错误。请检查以下步骤,然后重试。希望这可以帮助您解决问题。另外,我建议您检查官方的Documentation来部署您的应用。

=======================

1)检查捆绑器

$ bundle -v

=======================

2)如果不存在

$ gem install bundler

==========================

3)在开发小组中,我可能使用100颗宝石,但在生产小组中,我将仅使用少量宝石。     因此,我的所有配置都不得影响生产团队。

$ bundle install —without production

============================

4)安装heroku工具带(搜索Google以了解更多信息)     =>检查是否安装了Homebrew

$ brew -v

如果未安装,请在Google上搜索以安装Homebrew命令…     =>一旦准备就绪,然后安装heroku工具带

    $ brew install heroku-toolbelt

    $ heroku update

=================================

5)您应该注册heroku,然后

$heroku login (*password* for heroku)

如果您还没有SSH密钥,它将为您提供一个新密钥,然后说“是!”。如果它不提供要应用的任何密钥,则可以手动创建SSH密钥。

$mkdir ~/.ssh

$ssh-keygen -t rsa

==================================

6)创建要部署的heroku

$heroku create

==================================

7)部署之前

提交并推送所有已修改的文件

8)添加密钥:

$heroku keys:add

==================================

9)

$git push heroku master

================================

10)heroku给出了一个用于访问项目的随机名称,您可以轻松地对其进行更改

$heroku rename "new app name"

===================================

11)每次添加新模型并生成迁移时,您还必须部署迁移

$heroku run rails db:migrate

====================================