簡體   English   中英

將Rails App推送到Heroku時出錯

[英]Error when pushing Rails App to Heroku

我一直在試着部署我的第一個rails應用程序並試圖找出所有設置內容的railsstutorial.org。 這應該只是一鍵式的東西,更新到最新的ruby /最新的rails,設置git,你很高興,但這是一個巨大的頭痛。 對不起,我不得不發泄。

當我在我的測試應用程序first_app的當前目錄中嘗試推送到heroku時出現錯誤:

XXXXXX-Computer:first_app XXXXXX$ git push heroku master
fatal: The remote end hung up unexpectedly

搜索錯誤導致我https://git.wiki.kernel.org/index.php/GitFaq#Git_push_fails_with_.22fatal:_The_remote_end_hung_up_unexpectedly.22.3F ,這表明我的公鑰可能安裝不正確。 我已經能夠推送到git repo罰款並檢查我的heroku密鑰按預期吐出我的公鑰:

XXXXXX-Computer:first_app XXXXXX$ heroku keys
=== 1 key for XXXXXX@gmail.com
ssh-rsa AAAAB3NzaC...u4iGALvQ== XXXXXX@gmail.com

我與教程的唯一不同之處在於我使用的是ruby 1.8.7 / rails 3.03,因為我在使用ruby版本管理器rvm時遇到了一些麻煩。 我可以將ruby更新到1.9.2,但是當我去檢查rails版本時,我得到了這個:

XXXXXX-Computer:first_app XXXXXX$ rails -v
/Library/Ruby/Site/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)

from /Library/Ruby/Site/1.8/rubygems.rb:214:in activate' from /Library/Ruby/Site/1.8/rubygems.rb:1082:in / usr / bin / rails:18

這是我第一次使用git和rvm,所以如果這是一個基本問題我會道歉。 我已經嘗試了一段時間,並沒有在應該是一件簡單的事情上取得那么大的進展。 我非常感謝stackoverflow的集體天才可以提供任何幫助。 先感謝您。

Heroku會告訴你它是否是一個關鍵問題。 這個錯誤聽起來更像是一個git / network問題。

Heroku偶爾會出現推送問題,您可以在此處監控: http//status.heroku.com/ 當它發生時,您所能做的就是等待,稍后再試。

它也可能是你的heroku遙控器的配置。 你可以發布git remote show heroku的輸出嗎?

至於升級,它不應該影響你。 Gems特定於您安裝它們的ruby版本,因此如果您升級到1.9,則必須重新安裝您的gem。 這就是為什么rails在1.9上有錯誤的原因。

所以...在任何教程中都沒有真正提出它,但是從終端登錄到heroku解決了seg故障問題並得到了我的應用程序:

heroku login
  Email: ******
  Password: ******

git push heroku master

好極了!

您似乎無法在注釋中添加代碼段,並且不能使用回車鍵完成新行。 那個和現在較慢的連接可能導致我發送多個電子郵件通知。

無論如何,感謝您對寶石錯誤的回應和澄清。 這是git遠程顯示的輸出:

heroku
origin

和git遠程顯示heroku:

fatal: The remote end hung up unexpectedly

同樣的錯誤。

如果它有幫助,我只是cd到該目錄並檢查我的.git / config文件並看到:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
[remote "origin"]
    url = git@github.com:XXXXXX/first_app.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[remote "heroku"]
    url = git@heroku.com:stark-galaxy-XXX.git
    fetch = +refs/heads/*:refs/remotes/heroku/*

檢查heroku信息:

XXXXXX-Computer:first_app XXXXXX$ heroku info
=== stark-galaxy-XXX
Web URL:        http://stark-galaxy-XXX.heroku.com/
Git Repo:       git@heroku.com:stark-galaxy-XXX.git
Dynos:          1 
Workers:        0
Stack:          bamboo-ree-1.8.7
Addons:         Shared Database 5MB
Owner:          XXXXXX@gmail.com

我只是嘗試刪除我的應用程序,卸載heroku,然后再次嘗試。 我根據http://docs.heroku.com/renaming-apps#manually-updating-a-git-remote手動更新了一個git遠程:

XXXXXX-Computer:first_app XXXXXX$ git remote rm heroku
XXXXXX-Computer:first_app XXXXXX$ git remote add heroku git@heroku.com:quiet-mountain-XXX.git

並檢查它是否被添加:

XXXXXX-Computer:first_app XXXXXX$ git remote -v
heroku git@heroku.com:quiet-mountain-XXX.git (fetch)
heroku git@heroku.com:quiet-mountain-XXX.git (push)
origin git@github.com:XXX/first_app.git (fetch)
origin git@github.com:XXX/first_app.git (push)

但繼續得到:

XXXXXX-Computer:first_app XXXXXX$ git remote show heroku
fatal: The remote end hung up unexpectedly

XXXXXX-Computer:first_app XXXXXX$ git push heroku master
fatal: The remote end hung up unexpectedly

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM