I am using OS X.
ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0]
rails -v
Rails 3.0.8
which ruby
/Users/apple/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
which rails
/Users/apple/.rvm/gems/ruby-1.9.2-p180#rails3/bin/rails
When i use the command git push heroku master, I get
! Heroku push rejected, no Rails or Rack app detected
To git#heroku.com:testingnewyork.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:testingnewyork.git'
What should i do?
Looks similar to this question: push rails app to heroku
If you didn't run the git commands inside a Rails app, Heroku has no idea what you're pushing :)
You need to change directory into the application folder:
rails new testingnewyork
cd testingnewyork
Related
Im just new to Ruby and Ruby on Rails. I got an error shown below when I was following instructions from Michael Hartl's Ruby on Rails Tutorial:
[enter image description here][1]
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/ancient-sands-19579.git'
[1]: https://i.stack.imgur.com/RU3Zm.png
Ive tried most of solutions I can find on the Internet including:
try pull heroku master(This returns me an error that couldn't find remote ref master)
git switch -b newbranch
git push heroku newbranch(This gives me no error. The problem is Heroku's welcome page is still there. It makes no difference when I refresh the page with a new route and action added.)
Ive beem stuck here for hours and Im getting frustrated :(
I will appreciate all of you guys who try to get me out of this....
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?
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.
Did you commit the app to the Git Index?
The Gemfile and Gemfile.lock are probably indexed but not yet commited.
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.
I edited some code and tried to push to heroku and all of a sudden received strange errors about slug compilation and now I can't push to heroku. I don't know what happened I didn't mess with anything out of the ordinary.
Slug compilation error: failed to read buildpack metadata: error in release script
Asset precompilation completed (47.59s)
-----> Rails plugin injection
Injecting rails_log_stdout
Injecting rails3_serve_static_assets
-----> Discovering process types
/usr/bin/env: ruby: No such file or directory
! Push failed: failed to read buildpack metadata: error in release script.
! If the problem persists, see http://help.heroku.com and provide ID 8e6d0ded-66b7-4696-a204-2a2f0fdf6e57.
To git#heroku.com:apollojive.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:apollojive.git'
EDIT: Looks like this problem has been fixed. I was finally able to deploy
UPDATE: Appears to be fixed. Or at least I was able to push an update without error.
I'm seeing this error as well, but only when pushing to my "prod" app - not "stage". I guess it's time to take a break and eat some dinner :)
This has been resolved. It was an issue with a new release of the ruby buildpack and has since been resolved. You should be good to deploy to the platform now.
If you're still seeing this error, please do let us know by opening a support ticket. Thanks!
I believe it might have something to do with ruby version, since i was using 2.0.0-p0 (specified on Gemfile), and when I tried pushing I saw that it updated to a new version 2.0.0-p195, which has been recently released ( 14 may ).
There was this lines on Heroku log that suggested this:
Old: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]
New: ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]
UPDATE:
I've changed ruby version on Gemfile to 1.9.3 ( did a bundle and commited Gemfiles ) and it works.
When I push to heroku, it tells me that it fails to install gems with bundler and then it fails:
Git error: command `git fetch --force --quiet --tags 'git#github.com:holgersindbaek/streama.git' "refs/heads/*:refs/heads/*"` in directory /tmp/build_2e6gwsce8rtbt/vendor/bundle/ruby/1.9.1/cache/bundler/git/streama-bb31e974eacf3e56d77c4899ae1e3687c8245251 has failed.
If this error persists you could try removing the cache directory '/tmp/build_2e6gwsce8rtbt/vendor/bundle/ruby/1.9.1/cache/bundler/git/streama-bb31e974eacf3e56d77c4899ae1e3687c8245251'
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
To git#heroku.com:afternoon-spring-7047.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:afternoon-spring-7047.git'
It suggest that I remove the stream-chace, but I have no idea where that is.
Has anyone tried this before?
I'm on Rails 3.2.2, running MongoDB with Mongoid.
UPDATE:
I'm using ruby 1.9.3, so I think it's a bit funny it points me to a ruby 1.9.1 folder. Don't know if that has anything to do with it?
You're using the private git link for that repository:
git#github.com...
rather than:
git://github.com...
Because the Heroku shell isn't authorized to "privately" clone that GitHub repository, attempting to run bundle install on Heroku will fail. Change that link to the public clone URL.
when I push my rails 3 app git heroku master I get this error msg:
-----> Heroku receiving push
-----> Rails app detected
! Heroku Bamboo does not include any Rails gems by default.
! You'll need to declare it in either .gems or Gemfile.
! See http://docs.heroku.com/gems for details on specifying gems.
! Heroku push rejected, no Rails gem specified.
error: hooks/pre-receive exited with error code 1
To git#heroku.com:glowing-rain-62.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:glowing-rain-62.git'
I have gem 'rails', '3.0.3' specified in my gemfile, so I am not sure what the issue is....If anyone could help I would really appreciate it. Thanks..
Don't forget that Gemfile is case sensitive. Make sure the file is actually IN your repo. You should also have a Gemfile.lock file too. Which version of bundler are you running?
Have you successfully deployed to Heroku before?
If not you may want to double-check that rails, 3.0.3 is committed to your Git repo just as a sanity check...
I think the problem might be connected with the heroku server type (or idiomatically: stack). The normal stack (called Aspen, I think) is runned by Debian Etch which doesn't support newer versions of Rails (i.e. Rails 3) and neither Sinatra.
To solve the problem you can switch to the Bamboo stack which is runned by Debian Lenny. You can do it by switching the stack as followed:
heroku create yourname --stack bamboo-mri-1.9.2
"yourname" is of course the name of your application. After that it should work as it should.