git push heroku master doesn't seem to work

2019-05-14 05:16发布

问题:

I am following the guide on railstutorial.org. I get this error when I type the command on the title.

Counting objects: 66, done. Delta compression using up to 2 threads. Compressing objects: 100% (52/52), done. Writing objects: 100% (66/66), 86.47 KiB, done. Total 66 (delta 3), reused 0 (delta 0)

-----> Heroku receiving push -----> Rails app detected -----> Detected Rails is not set to serve static_assets Installing rails3_serve_static_assets... done -----> Gemfile detected, running Bundler version 1.0.0 Unresolved dependencies detected; Installing... You have modified your Gemfile in development but did not check the resulting snapshot (Gemfile.lock) into version control

   You have added to the Gemfile:
   * sqlite3-ruby (= 1.3.7)

   You have deleted from the Gemfile:
   * sqlite3-ruby (= 1.2.5)
   FAILED: http://docs.heroku.com/bundler

! Heroku push rejected, failed to install gems via Bundler

error: hooks/pre-receive exited with error code 1 To git@heroku.com:morning-mountain-34.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'git@heroku.com:morning-mountain-34.git'

then when i type:

$ heroku open

I get a mountain site:http://morning-mountain-34.heroku.com/ which isn't supposed to be the case: should be first_app

回答1:

found the solution:

first the problem occured possibly because of the so many mistakes I made earlier that I kept on closing the terminal.

so things were probably disabled. like "git init" "git add ." and "git commit -m" I don't really know which one but after doing all those and typing: git push heroku master.

It finally went through and when I type: heroku open. it still opens to morning-mountain-34 but it contains my first app now (which is nothing but its the one on the guide too :))