0

I am trying to push the first version of a Ruby on Rails app to Heroku.

When I run git push heroku master the errors I get are:

remote: -----> Failed to detect app matching no buildpack
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/myapp' 

Since no buildpack was detected, I tried to set it manually. When I run heroku buildpacks I get Buildpack URL heroku/ruby, but I still get the same error.

I checked this solution and my gemfile is present, my ruby version in the gemfile is defined and my gemfile.lock has the railties gem.

Heroku logs just regurgitate the errors above so it wasn't helpful

Any suggestions for what else my be wrong?

coreyward
  • 77,547
  • 20
  • 137
  • 166
codechef
  • 55
  • 1
  • 8
  • Run `git ls-files | grep Gemfile` in your project. You should see `Gemfile` and `Gemfile.lock` on separate lines without any paths before them. If you don't, you should [go back to this question](https://stackoverflow.com/questions/9542665/remote-rejected-master-master-pre-receive-hook-declined) and review the accepted answer more closely. – coreyward Mar 13 '17 at 18:32
  • They are on separate lines without any paths before them – codechef Mar 13 '17 at 18:56

3 Answers3

0

Did you commit the app to the Git Index?
The Gemfile and Gemfile.lock are probably indexed but not yet commited.

ashmaroli
  • 5,209
  • 2
  • 14
  • 25
0

Did you try putting the putting ruby version number on top of the GemFile.

ruby '<your ruby version>'

the following line above should be at the top of gemfile. Also make sure you have Gemfile and Gemfile.lock files committed, those will be checked upon pushed to heroku servers.

Joseph Borne
  • 257
  • 2
  • 11
0

You need to have the rails project at the root. If it's not, Heroku will not know the entry point.

So this: somefolder/my_rails_app will not work.

Steez
  • 219
  • 5
  • 17