2010-12-20 67 views
1

我一直走過railstutorial.org試圖部署我的第一個rails應用程序,並且一直在試圖弄清楚所有安裝的東西。這應該都是真正的單擊操作,更新到最新的ruby/newest rails,設置git,你很好去,但這是一個非常頭痛的問題。對不起,我不得不發泄。將Rails應用程序推送到Heroku時出錯

當我嘗試推到Heroku的,而我在我的測試應用程序first_app的當前目錄是我的錯誤來了:

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回購罰款和檢查我的Heroku鍵吐出預期我的公鑰:

XXXXXX-Computer:first_app XXXXXX$ heroku keys 
=== 1 key for [email protected] 
ssh-rsa AAAAB3NzaC...u4iGALvQ== [email protected] 

我從教程只偏差是我使用Ruby 1.8.7/3.03軌道因爲我在使用ruby版本管理器rvm時遇到了一些麻煩。我可以更新紅寶石1.9.2,但是當我去檢查鐵軌的版本,我得到這個:

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) 

從/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的集體天才可以提供的任何幫助。先謝謝你。

回答

1

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

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

git push heroku master 

耶!

3

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

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

它也可能是您的配置爲heroku遠程。你可以發佈git remote show heroku的輸出嗎?

至於升級,它不應該影響你在這裏。寶石是特定於你安裝它們的紅寶石版本,所以如果你升級到1.9,你將不得不重新安裝你的寶石。這就是爲什麼rails在1.9上出錯。

0

看來你不能在註釋中添加代碼片段,並且新行不能用回車鍵完成。這和現在較慢的連接可能導致我發送給你多個電子郵件通知。

無論如何,感謝您對寶石錯誤的迴應和澄清。這裏是git的遠程展現輸出中:

heroku 
origin 

和git遠程顯示的Heroku:

fatal: The remote end hung up unexpectedly 

同樣的錯誤。

如果它有幫助,我只需cd'd到該目錄並檢查我的。混帳/ config文件中看到:

[core] 
    repositoryformatversion = 0 
    filemode = true 
    bare = false 
    logallrefupdates = true 
    ignorecase = true 
[remote "origin"] 
    url = [email protected]:XXXXXX/first_app.git 
    fetch = +refs/heads/*:refs/remotes/origin/* 
[remote "heroku"] 
    url = [email protected]: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:  [email protected]:stark-galaxy-XXX.git 
Dynos:   1 
Workers:  0 
Stack:   bamboo-ree-1.8.7 
Addons:   Shared Database 5MB 
Owner:   [email protected] 

我只是想刪除我的應用程序,卸載的Heroku,然後再次嘗試。我手動更新遠程Git按http://docs.heroku.com/renaming-apps#manually-updating-a-git-remote

XXXXXX-Computer:first_app XXXXXX$ git remote rm heroku 
XXXXXX-Computer:first_app XXXXXX$ git remote add heroku [email protected]:quiet-mountain-XXX.git 

,並檢查它是由補充說:

XXXXXX-Computer:first_app XXXXXX$ git remote -v 
heroku [email protected]:quiet-mountain-XXX.git (fetch) 
heroku [email protected]:quiet-mountain-XXX.git (push) 
origin [email protected]:XXX/first_app.git (fetch) 
origin [email protected]: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 
+0

你可以試試'ssh git @ heroku.com'並看看它產生了什麼樣的輸出?我得到:'!您只能通過git push和pull命令通過ssh訪問Heroku。連接到heroku.com關閉。' – cdmwebs 2010-12-21 21:03:48

+0

我剛剛收到:分段錯誤。 (同樣爲了澄清,這是在我的first_app的cd中。) – tarabyte 2010-12-21 21:26:55

+0

我剛剛在維基百科上檢查並發現:「程序試圖訪問不允許訪問的內存位置時發生分段錯誤,或嘗試以不允許的方式訪問內存位置(例如,嘗試寫入只讀位置或覆蓋部分操作系統)我的硬盤上只剩下大約7GB的內存,我真的認爲這是問題,也許是關鍵的東西嗎?我用與github相同的電子郵件註冊了heroku ... – tarabyte 2010-12-21 21:35:53

相關問題