Trouble re(deploying) to heroku - ruby-on-rails

I had trouble re-deploying the sample app from Hartls book:
! No such app as murmuring-beyond-6630.
So then I logged into Heroku, deleted the app and created another...
fatal: The remote end hung up unexpectedly
yuliya#ubuntu:~/rails_projects/sample_app$ heroku create
Creating cryptic-plains-9409... done, stack is cedar
http://cryptic-plains-9409.herokuapp.com/ | git#heroku.com:cryptic-plains-9409.git
yuliya#ubuntu:~/rails_projects/sample_app$ heroku keys:add
Found existing public key: /home/yuliya/.ssh/yuliya.pub
Uploading SSH public key /home/yuliya/.ssh/yuliya.pub... done
yuliya#ubuntu:~/rails_projects/sample_app$ git push heroku master
! No such app as murmuring-beyond-6630.
Still referenced previous app so I removed it using the git rm heroku command. Then I ran heroku create. Then tried to push the app again...
yuliya#ubuntu:~/rails_projects/sample_app$ git remote add heroku git#heroku.com:cryptic-plains-9409
yuliya#ubuntu:~/rails_projects/sample_app$ git push heroku master
! Invalid path.
! Syntax is: git#heroku.com:<app>.git where <app> is your app's name.
I am completely stuck and would appreciate any help here. I am brand new to this, and thank you for your time!

I believe you left off the .git, which is what the error is complaining about.
Try this,
git remote set-url heroku git#heroku.com:cryptic-plains-9409.git
git push heroku master
Referenced this question:
How does "git push heroku master" know where to push to and how to push to a different repo?

Related

Can't push on heroku

I’ve just cloned one of my repositories on github, I've made some changes and I would like to send it on the heroku application. But when I try to run git push heroku master, I get :
fatal: 'heroku' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
What can I do to solve it?
This is because there's no remote named heroku. You can see your remotes by typing git remote -v. For my 'example' app I see the following:
$ git remote -v
heroku git#heroku.com:example.git (fetch)
heroku git#heroku.com:example.git (push)
If it's missing, you can add the remote with the following command:
git remote add heroku git#heroku.com:example.git
where example is the name of your heroku app.
Before you can do
$ git push heroku master
you need to setup heroku by following the steps given at Getting Started with Heroku. Once you have setup heroku, logged in,created your app.
Verify that git remote is added
$ git remote -v
it should list a remote named heroku. if it does then the error heroku' does not appear to be a git repository will go away
If you have followed the steps in tutorial you just need to login in again:
cmd "heroke login"

Heroku Core Data buildpack, no cedar supported app detected

I'm attempting to migrate an existing Core Data (with local store) project to Heroku using AFIncrementalStore and the Core Data Buildpack, but pushing to Heroku keeps failing.
The primary differences between my app setup and that in the aforelinked tutorial:
I've set up the Xcode workspace with the AFNetworking/AFIncremental dependencies, but not actually changed any code yet.
The directory containing the Xcode project/workspace files is one level down from the root of my git repo. This means heroku create --buildpack git://github.com/mattt/heroku-buildpack-core-data.git fails to create the git remote named heroku, but I can cd .. and heroku git:remote -a appname and that seems to be cool.
I'm working on a branch other than master in my git repo, so when I push to Heroku I need to use git push heroku my_local_branch:master.
However, that git push doesn't get anywhere, not even into the Core Data Buildpack stuff (as far as I can tell):
-----> Fetching custom git buildpack... done
! Heroku push rejected, no Cedar-supported app detected
To git#heroku.com:appname.git
! [remote rejected] my_local_branch -> master (pre-receive hook declined)
I just went through one of my projects and arranged it to mimic yours.
The buildpack will fail if the .xcdatamodeld isn't within 1 folder level of root. I suggest filing an issue on Github.
When you created the Heroku app, maybe you didn't pass in the --buildpack parameter. You can check by running heroku config and verify there's a BUILDPACK_URL setting pointing at the buildpack repo. If that's missing, you can add it:
heroku config:add BUILDPACK_URL=https://github.com/some/buildpack.git -a myapp
Documentation here.

How to reset everything Heroku in my Git/Rails 3.1 Project

I solved my problem while writing this post, but I thought this might be good information for other noobs like me :)
To solve the problem below edit the following file
.git/config
There's a section that looks like this
[remote "heroku"]
url = git#heroku.com:adjective-noun-1234.git
fetch = +refs/heads/*:refs/remotes/heroku/*
This is what git tries to push to. Just change the line
url = git#heroku.com:adjective-noun-1234.git
to whatever new Heroku project you created. Git should now be able to push to Heroku again.
I have gotten my second Rails app ever to a working state and want to deploy it. So I followed all the steps for Heroku deployment in the Ruby on Rails Tutorial (I had the deployment working for the sample app from the book) using:
heroku create
I then push my project with
git push heroku master
The project doesn't work although I can't find any errors in the Heroku logs, all I get is:
We're sorry, but something went wrong.
We've been notified about this issue and we'll take a look at it
shortly.
So I looked around the Heroku Support Section and found the official Rails 3.0 / 3.1 deployment guide:
http://devcenter.heroku.com/articles/rails3
http://devcenter.heroku.com/articles/rails31_heroku_cedar
I went to the Heroku Web Frontend > General Info > Destroy App because I wanted to continue my efforts with a clean slate.
Following the guide I created a Heroku project for the cedar stack:
heroku create --stack cedar
And push it to Heroku using
git push heroku master
THE PROBLEM: for some reason git is still trying to push to the old Heroku project!!!
resulting in an error
fatal: The remote end hung up unexpectedly
Check your remote repositories, and update it to the new heroku name:
git remote -v
Then remove the heroku one that is wrong:
git remote rm heroku
Then add the new one
git remote add heroku git#heroku.com:sitename.git
This is a bit extreme, but worked for me....
heroku destroy appname
heroku create
git push heroku master

Pushing app to heroku problem

I am trying to push my app to heroku and I get the following message:
$ heroku create
Creating electric-meadow-15..... done
Created http://electric-meadow-15.heroku.com/ | git#heroku.com:electric-meadow-1
5.git
$ git push heroku master
! No such app as fierce-fog-63
fatal: The remote end hung up unexpectedly
It's weird that I am getting this now, I have pushed the app to heroku many times without issue. the especially weird thing is, fierce-fog-63 is an old app that I made and deleted a long time ago. Why is it now that heroku is trying to push to this app that doesn't exist anymore, especially when I have created a new one? Any suggestions?
Type this and I think you'll see the problem:
git remote -v
Fix it like this:
git remote rm heroku
git remote add heroku git#heroku.com:electric-meadow-15.git
I was getting the second error you posted "failed to push some refs to 'git#heroku.com:floating-stone-94.git' " (with a different app name) and i got rid of it by doing the following:
git remote rm heroku
heroku create
you should see a line that says 'Git remote heroku added'. Also
git remote -v
should now have the correct app.
For all the people who this does not work, check your ~/.heroku/credentials
If the email or token does not match the account, you won't see your apps.
If you got here and think you have a similar problem but all of the other stuff suggested does not work you might want to try:
heroku restart

cloned project from github. heroku does not work

I cloned a project from github over to my desktop. I used to work on it form my laptop.
However, on laptop heroku does not seem to work for this app eventhough i have it installed.
First problem:
heroku open
>No app specified.
>Run this command from app folder or set it adding --app <app name>
I did not have to specify the --app on my laptop. Because I guess I did command heroku create initially on the lapop.
Second Probelm:
git push heroku master
gives errors
fatal: 'heroku' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
and heroku list
says
! This version of the heroku gem has been deprecated.
! Please update it by running: gem update heroku
First do:
git remote add heroku git#heroku.com:{my-project-name}.git
Where you replace {my-project-name} with the name of the Heroku application as it appears in your Heroku account. For example, if your Heroku account says you have an application named flowing-water-397, then the line would be:
git remote add heroku git#heroku.com:flowing-water-397.git
Then Git and the Heroku gem will know that this Git repo is connected to a Heroku.com application. Then you can do things such as:
git push heroku master
heroku open
Finally, learn a little bit more about Git Remotes.
In addition to the git remote add ... that #Justice mentioned, I also needed to run
git config heroku.remote heroku
(solution found here)
I believe I get the error No app specified. Run this command from an app folder or specify which app to use with --app when I run any ambiguous heroku commands. Example:
heroku logs
It's ambiguous because I have multiple remote repositories specified in my project's .git/config file. The solution for me is simply to specify the remote repository. Example:
heroku logs --remote staging
In the above line --remote staging corresponds to the following in my project's .git/config file:
[remote "staging"]
url = git#heroku.accountname:foo-bar-1234.git
fetch = +refs/heads/*:refs/remotes/staging/*
I hope this helps you.. if not, then perhaps it may help someone else!
When I had this issue it was because I created more than one remote app on heroku.
To remove an existing remote app from heroku use:
git remote rm heroku
then go back and use heroku create to start the process over using the correct app name heroku gives you.
Solution found here:
solution

Resources