I've been walking through railstutorial.org trying to deploy my first rails app and have been banging my head trying to figure out all the setup stuff. This should all really be a one-click thing, update to newest ruby/newest rails, setup git and you're good to go, but it's a HUGE headache. Sorry I had to vent.
My error comes when I try to push to heroku while I'm in the current directory of my test app first_app:
XXXXXX-Computer:first_app XXXXXX$ git push heroku master
fatal: The remote end hung up unexpectedly
Searching the error led me to https://git.wiki.kernel.org/index.php/GitFaq#Git_push_fails_with_.22fatal:_The_remote_end_hung_up_unexpectedly.22.3F which suggests that my public key may not be installed correctly. I have been able to push to a git repo fine and checking my heroku keys spits out my public key as expected:
XXXXXX-Computer:first_app XXXXXX$ heroku keys
=== 1 key for XXXXXX@gmail.com
ssh-rsa AAAAB3NzaC...u4iGALvQ== XXXXXX@gmail.com
My only deviation from the tutorial is that I'm using ruby 1.8.7/rails 3.03 because I was having some trouble with ruby version manager rvm. I could update ruby to 1.9.2, but when I went to check the rails version, I got this:
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
gem'
from /usr/bin/rails:18
This is my first time using git and rvm as well, so I apologize if it's a basic question. I've been trying at this for a while and haven't been making that much progress for what should be a simple thing. I really appreciate any help the collective genius of stackoverflow can offer. Thank you in advance开发者_开发百科.
Heroku would tell you if it were a key issue. That error sounds more like a git/network issue.
Heroku occasionally has issues with pushing, which you can monitor here: http://status.heroku.com/. When it happens, all you can do is wait and try again later.
It could also be your config for the heroku remote. Could you post the output of git remote show heroku
to be sure?
As for upgrading, it shouldn't affect you here. Gems are specific to the version of ruby you installed them for so if you upgrade to 1.9 you'll have to reinstall your gems. That's why rails had an error on 1.9.
So...nothing really suggested it in any of the tutorials, but logging into heroku from the terminal solved the seg fault problem and got my app up:
heroku login
Email: ******
Password: ******
git push heroku master
Yay!
It seems that you cannot add code snippets in comments and that new lines are not done with the enter key. That and a slower connection right now may have caused me to send you multiple email notifications.
Anyways, thank you for your response and clarification about the gems error. Here is the ouput of git remote show:
heroku
origin
and git remote show heroku:
fatal: The remote end hung up unexpectedly
The same error.
If it helps at all, I just cd'd to that directory and checked my .git/config file and saw:
[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/*
Checking heroku info:
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
I just tried deleting my app, uninstalling heroku, then trying again. I manually updated a git remote as per 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 git@heroku.com:quiet-mountain-XXX.git
And checked that it was added by:
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)
but continue to get:
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
精彩评论