Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

!Heroku push rejected

Can any one work out this error please?

myname-MacBook-Pro:treebook myname$ git push origin master
Username for 'https://github.com': myname
Password for 'https://myname@github.com': 
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 380 bytes, done.
Total 4 (delta 1), reused 0 (delta 0)
To https://github.com/myname/appname.git
   ddd4db7..8a506b7  master -> master
myname-MacBook-Pro:treebook myname$ git push heroku master
Counting objects: 263, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (207/207), done.
Writing objects: 100% (263/263), 276.18 KiB | 170 KiB/s, done.
Total 263 (delta 50), reused 143 (delta 25)

 !     Heroku push rejected, no Cedar-supported app detected

To git@heroku.com:glacial-peak-5174.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:glacial-peak-5174.git'

5 Answers

Alan Johnson
Alan Johnson
7,625 Points

What do you get if you run git status on the command line? Also, do you have a file named Gemfile in your directory?

James Barnett
James Barnett
39,199 Points

@Giles - It appears, there's a conflict between git, Heroku & OS X.

This relates to an issue with the case-insensitivity of the OS X filesystem (in its default configuration) and the case-sensitivity of (most) Linux filesystems.

There's a work around:

cp gemfile Gemfile.tmp 
git rm gemfile 
git commit -m "Remove gemfile" 
mv Gemfile.tmp Gemfile 
git add Gemfile 
git commit -m "Add Gemfile"

source: http://www.samanthajohn.com/post/19301082485/gotcha-with-git-and-heroku

Hi Alan My status is as follows

# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   ../.CFUserTextEncoding
#   ../.DS_Store
#   ../.Trash/
#   ../.adobe/
#   ../.android/
#   ../.bash_history
#   ../.bash_profile
#   ../.cups/
#   ../.dropbox/
#   ../.filezilla/
#   ../.gem/
#   ../.gitconfig
#   ../.heroku/
#   ../.imagineer_log.txt
#   ../.irb-history
#   ../.netrc
#   ../.ssh/
#   ../.subversion/
#   ../.viminfo
#   ../Desktop/
#   ../Documents/
#   ../Downloads/
#   ../Dropbox/
#   ../Google Drive/
#   ../Library/
#   ../Movies/
#   ../Music/
#   ../Pictures/
#   ../Project
#   ../Public/
#   ../RPDLXMAC2011.lic
#   ../VirtualBox VMs/
#   ../artbook/
#   ../facebuck/
#   ../mobilesurveyapp/
#   ../tasks/
nothing added to commit but untracked files present (use "git add" to track)

Hi James I tried that to no avail thanks for your help Giles

Alan Johnson
Alan Johnson
7,625 Points

It looks like you have a git repo one more directory up, but not in your treebook directory. Did you intend to have a git repo in your home folder? If not, I'd move up a folder (cd ..) and rm -rf .git. That'll kill that errant git repo. If you did intend to have one there, though, no worries.

Once you've removed that git repo, you'll want to cd treebook to get back into the project directory and do a git init . to set up a git repo in your treebook folder. Then you can do heroku git:remote to add the heroku settings you need, and then you're ready to push up to Heroku.

Let me know if something goes wrong there - this stuff can be pretty non-straightforward to troubleshoot over a forum. :smile: