I am trying to deploy a basic app from Github to Heroku.
Following directions from Heroku's guide
Here's the thing. When I clone from the github repository, I clone a specific branch that's 8 commits ahead of master.
The reason why I clone that specific branch is that it's the most advanced on. Each branch is built upon the previous branch.
I don't want to merge that branch into the master because I don't know how to undo that.
By the time I try to do this step from the guide above: heroku ps:scale web=1, I always get this: Scaling dynos... failed
! App must be deployed before dynos can be scaled.
Why does this happen? Advice?
Please let me know if this question needs further clarification. Thank you.
EDIT
For the record, it has the Procfile which has this in it: web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
EDIT 2
When I do git push heroku branch_name - this is what I get:
Delta compression using up to 4 threads.
Compressing objects: 100% (243/243), done.
Writing objects: 100% (389/389), 727.55 KiB | 0 bytes/s, done.
Total 389 (delta 111), reused 389 (delta 111)
remote: Pushed to non-master branch, skipping build.
EDIT 3
I followed the first answer from this thread.
It worked, and restarted the app in Heroku.
But I restarted it again with this line: heroku restart --app name_of_app_in_heroku and got this: Restarting dynos... done
Then I tried to do heroku open --app name_of_app_in_heroku, and all I get is the basic welcome page. How do I overcome this?
Also, I just looked at my Heroku's dashboard, and checked the app, and it says it has no dynos. How is that possible?
EDIT 4
Also, I just ran this command: heroku pg:info and got this answer: name_of_app_in_heroku has no heroku-postgresql databases.
But that shouldn't be, I can see the DB's URL in the app's config vars in the settings of the app's dashboard.
It sounds like the app's never been deployed (because you're trying to deploy non master branch and heroku has been ignoring the pushes)
When you push to heroku, the name for the branch needs to be master on the heroku side.
By default git push keeps the same name for both sides:
git push heroku some_branch
Tries to (assuming upstream is setup appropriately etc) update a branch called "some_branch" on the heroku remote, with your local branch of the same name.
To use a different name you'd do
git push heroku some_branch:master
Which means push the changes from the branch called some_branch locally to heroku's master branch
When you deploy your app try doing this
gp heroku master -f
heroku run rake db:migrate --app APPNAME
heroku restart --app APPNAME
heroku open --app APPNAME
This are the lines that I use when I deploy a project to Heroku
Related
I have successfully deployed by rails app to Heroku, no problems. But now I am unable to update it with changes that I make to my code. When I try:
git add .
git commit -m "asdasd"
git push heroku master
I am told:
On branch master
Your branch is up-to-date with 'heroku/master'.
nothing to commit, working tree clean
I have tried Heroku ps, which gives me this:
Free dyno hours quota remaining this month: 541h 43m (98%)
Free dyno usage for this app: 0h 0m (0%)
For more information on dyno sleeping and how to upgrade, see:
https://devcenter.heroku.com/articles/dyno-sleeping
=== web (Free): bin/rails server -p $PORT -e $RAILS_ENV (1)
web.1: up 2019/01/18 14:37:10 -0600 (~ 2m ago)
So it seems like nothing is really going on, and for some reason there is no way of reaching the heroku site through the cli. The logs don't show anything interesting, just simply fetching pages and the like.
The only other thing is that I changed the name of the site in the heroku website, and I think there was something I should have done in the cli, but now I've lost it. In the cli the name of the app is the same so I guess this isn't a problem.
Can anyone help? Much thanks :-)
You can search on the web interface settings your project's git repository url and check if is the same that your local remote has.
.git/config
[remote "heroku"]
url = https://dir/repo.git
fetch = +refs/heads/*:refs/remotes/heroku/*
I am Rails newbie and learning to build rails apps. First time I deploy from my home PC and then everything just fine, then I want to work on the apps and deploy from my laptop and work PC, but it turn out I cannot deploy my update code. Every time I push to github work fine, but when I want to push to heroku it didn't deploy my code. I opened my heroku apps, and it's obviously out-dated
$ git push
Counting objects: 26, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (14/14), 1.22 KiB, done.
Total 14 (delta 9), reused 0 (delta 0)
To git#github.com:myprofile/myapp.git
bb15762..94d0674 master -> master
$ git push heroku master
Everything up-to-date
I use Linux on virtualBox and I clone it for each PC, so all has identical ID and MAC I believe. I did all necessary git remote add heroku and in the end heroku just ignore my update code and never rerun the build.
I tried to run this command $ heroku rollback $ heroku restart --app MyApp as well in order to get my update code push to heroku still did't work either. When I run $ heroku info --app MyApp it give all my app info
=== my-app
Addons: heroku-postgresql:dev
Git URL: git#heroku.com:my-app.git
Owner Email: myemail#gmail.com
Repo Size: 13M
Slug Size: 17M
Stack: cedar
Web URL: http://my-app.herokuapp.com/
I just wonder what happen and only using my Home PC to push to heroku is kind of annoying for me because I need to work on it anywhare if that possible. Thank you for the all future answers!
When I call this command git remote -v it gives me these:
all git#github.com:myprofile/my-aap.git (fetch)
all git#github.com:myprofile/my-aap.git (push)
github git#github.com:myprofile/my-aap.git (fetch)
github git#github.com:myprofile/my-aap.git (push)
heroku git#github.com:myprofile/my-aap.git (fetch)
heroku git#github.com:myprofile/my-aap.git (push)
origin git#github.com:myprofile/my-aap.git (fetch)
origin git#github.com:myprofile/my-aap.git (push)
I resolved this issue. #phoet - Thank you for the hints. I was adding wrong remote master to heroku that is the reason why my push didn't go through.
So I remove all the existing remote and adding again. Now everything works with little adjustment.
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
I'm creating a Rails app with Rails 3.1.3:
git init
git remote add heroku <my heroku repo>
git add .
git commit -a -m "First commit"
git push heroku master
Got:
Counting objects: 102, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (86/86), done.
Writing objects: 100% (102/102), 315.47 KiB, done.
Total 102 (delta 3), reused 0 (delta 0)
**-----> Heroku receiving push
! Heroku push rejected, no Cedar-supported app detected**
To git#heroku.com:electric-dusk-3217.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to <my heroku rep>
I had a similar problem, but with Django (incorrectly named "requirements.txt"). I think to generalize the other answers here, when you get this error it's because Heroku is missing some key file that it uses to identify your app (and its type).
php: index.php
python: requirements.txt
ruby: Gemfile # note the capitalization
node: package.json
The problem was that my "Gemfile" was named "gemfile"
I ran into this error message, but my problem was that my rails app was not in the root directory of my git repo. After I moved the files into the root dir, everything worked.
Heroku detects a supported app by looking for specific project files. To find the requirements for your language, start here.
For Node.js, you need a package.json.
For Python applications you need a requirements.txt.
etc.
Not associated with a new app, but... I ran into this same error message after installing a custom BUILDPACK on heroku and then forgetting about it. The next time I went to deploy to heroku I saw:
-----> Fetching custom git buildpack... done
! Push rejected, no Cedar-supported app detected
The fix was to check:
heroku config
And, there, I found a Var called BUILDPACK_URL which I had to unset with:
heroku config:unset BUILDPACK_URL
... and voila!
Another cause: I was pushing master, while working on a non-master branch. My master branch didn't have requirements.txt.
I didn't want to push from master, but heroku only pays attention to the master branch. The solution was to push my local branch to heroku's master branch:
git push heroku local_branch:master
Another cause of this error for Rails apps: we had this deploy error occur when we hadn't removed a git merge conflict from our Gemfile.lock file.
I had the same issue. "Gemfile" was included in ".gitignore" and has therefore not been part of the deployment. Heroku requires Gemfile for Rails projects.
I fixed this by making a superficial change to my Gemfile and recommitting. For some reason it wasn't included in my last commit.
I met the same problem here.
My check as follow:
1. Make sure "foreman start" works well locally.
2. Make sure only one new app create on your heroku account.
Hope it help.
I was following the RailsTutorial.org steps and this error showed up. None of the answers on this post worked. Then I saw this comment that led to this answer which was the only thing that worked for me so that might solve other people's problems with the tutorial as well.
When this problem appears with the project based on static files (only html, css and js) it is recommended to follow this guidlines:
https://discussion.heroku.com/t/push-rejected-no-cedar-supported-app-detected/640/3
I also had the problem with django based app. Everything seemed to be ok: file names and other settings.
The problem was that in heroku console there was a BUILDPACK_URL setting defined for node.js - thus django application was rejected.
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