繁体   English   中英

我有推到heroku的问题

[英]I'm having issue of pushing to 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'

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

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

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM